svn commit: r251433 - head/bin/sleep

Jilles Tjoelker jilles at FreeBSD.org
Wed Jun 5 20:15:19 UTC 2013


Author: jilles
Date: Wed Jun  5 20:15:18 2013
New Revision: 251433
URL: http://svnweb.freebsd.org/changeset/base/251433

Log:
  sleep: Explain in a comment why the [EINTR] check is there.
  
  Suggested by:	eadler

Modified:
  head/bin/sleep/sleep.c

Modified: head/bin/sleep/sleep.c
==============================================================================
--- head/bin/sleep/sleep.c	Wed Jun  5 19:54:28 2013	(r251432)
+++ head/bin/sleep/sleep.c	Wed Jun  5 20:15:18 2013	(r251433)
@@ -82,6 +82,12 @@ main(int argc, char *argv[])
 	time_to_sleep.tv_nsec = 1e9 * (d - time_to_sleep.tv_sec);
 
 	signal(SIGINFO, report_request);
+
+	/*
+	 * Note: [EINTR] is supposed to happen only when a signal was handled
+	 * but the kernel also returns it when a ptrace-based debugger
+	 * attaches. This is a bug but it is hard to fix.
+	 */
 	while (nanosleep(&time_to_sleep, &time_to_sleep) != 0) {
 		if (report_requested) {
 			/* Reporting does not bother with nanoseconds. */


More information about the svn-src-head mailing list