[Box Backup-commit] COMMIT r2004 - box/trunk/lib/common

boxbackup-dev at fluffy.co.uk boxbackup-dev at fluffy.co.uk
Sat Dec 15 20:07:04 GMT 2007


Author: chris
Date: 2007-12-15 20:07:04 +0000 (Sat, 15 Dec 2007)
New Revision: 2004

Modified:
   box/trunk/lib/common/Test.h
Log:
Log sleep time and resleeps in safe_sleep (only used in tests).


Modified: box/trunk/lib/common/Test.h
===================================================================
--- box/trunk/lib/common/Test.h	2007-12-15 20:04:56 UTC (rev 2003)
+++ box/trunk/lib/common/Test.h	2007-12-15 20:07:04 UTC (rev 2004)
@@ -437,10 +437,17 @@
 	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
 }
 




More information about the Boxbackup-commit mailing list