Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 5 Jun 2013 20:15:19 +0000 (UTC)
From:      Jilles Tjoelker <jilles@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r251433 - head/bin/sleep
Message-ID:  <201306052015.r55KFJGp027353@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
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. */



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201306052015.r55KFJGp027353>