We should not consider values below -1 as valid timeout values, this is
is unexpected and could lead to EINVAL errors returned by sem_timedwait.
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
}
if (str_timeout)
constructor_delay_ms = strtol(str_timeout, NULL, 10);
}
if (str_timeout)
constructor_delay_ms = strtol(str_timeout, NULL, 10);
+ /* All negative values are considered as "-1". */
+ if (constructor_delay_ms < -1)
+ constructor_delay_ms = -1;
return constructor_delay_ms;
}
return constructor_delay_ms;
}