Commit 684e20c1 authored by Adam Wujek's avatar Adam Wujek 💬

proto-ext-whiterabbit: exit if clock_period_ps <= 0

Avoid crash of PPSI when SIGFPE in ts_hardwarize, just exit...
To be fixed.
Signed-off-by: Adam Wujek's avatarAdam Wujek <adam.wujek@cern.ch>
parent 16fbc85d
......@@ -87,6 +87,12 @@ static void ts_hardwarize(struct pp_time *time, int clock_period_ps,
{
int32_t s, ns, ps, clock_ns;
if (clock_period_ps <= 0) {
pp_error("%s : Invalid clock period %d\n",
__func__, clock_period_ps);
exit(-1);
}
/* clock_period_ps *must* be a multiple of 1000 -- assert()? */
clock_ns = clock_period_ps / 1000;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment