I\'m having a strange problem. I have the following code:
dbg(\"condwait: timeout = %d, %d\\n\",
abs_timeout->tv_sec, abs_timeout->tv_nsec);
Overflow in timespec
is usually the culprit for weird timeouts.
Check for EINVAL:
void timespec_add(struct timespec* a, struct timespec* b, struct timespec* out)
{
time_t sec = a->tv_sec + b->tv_sec;
long nsec = a->tv_nsec + b->tv_nsec;
sec += nsec / 1000000000L;
nsec = nsec % 1000000000L;
out->tv_sec = sec;
out->tv_nsec = nsec;
}