diff options
Diffstat (limited to 'lib')
-rw-r--r-- | lib/common/Test.h | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/lib/common/Test.h b/lib/common/Test.h index 66e7fc7f..cf7cb713 100644 --- a/lib/common/Test.h +++ b/lib/common/Test.h @@ -437,10 +437,17 @@ inline void safe_sleep(int seconds) Sleep(seconds * 1000); #else struct timespec ts; + memset(&ts, 0, sizeof(ts)); ts.tv_sec = seconds; ts.tv_nsec = 0; + BOX_TRACE("sleeping for " << seconds << " seconds"); while (nanosleep(&ts, &ts) == -1 && errno == EINTR) - { /* sleep again */ } + { + BOX_TRACE("safe_sleep interrupted with " << + ts.tv_sec << "." << ts.tv_nsec << + " secs remaining, sleeping again"); + /* sleep again */ + } #endif } |