1.0.42.50: workaround a Darwin nanosleep() bug
authorNikodemus Siivola <nikodemus@random-state.net>
Tue, 21 Sep 2010 13:10:37 +0000 (13:10 +0000)
committerNikodemus Siivola <nikodemus@random-state.net>
Tue, 21 Sep 2010 13:10:37 +0000 (13:10 +0000)
 Fixes lp#640516.

 It turns out that on Darwin, if a nanosleep() call is interrupted,
 and the signal handler takes longer than the requested sleep time
 was, then the call will return with EINTR and (unsigned)-1 in the
 remaining seconds.

 Since we call nanosleep() again when it returns with EINTR with the
 remaining time, this would cause us to sleep ~136 years...

 So, check that the remainder is not increasing before calling
 nanosleep() again.

 Many, many thanks to Joe Lobraco who reported and diagnosed the
 issue.


No differences found