From owner-svn-src-head@FreeBSD.ORG Wed Jun 5 20:15:19 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 68025645; Wed, 5 Jun 2013 20:15:19 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 5A7A61EEE; Wed, 5 Jun 2013 20:15:19 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r55KFJoe027354; Wed, 5 Jun 2013 20:15:19 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r55KFJGp027353; Wed, 5 Jun 2013 20:15:19 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201306052015.r55KFJGp027353@svn.freebsd.org> From: Jilles Tjoelker Date: Wed, 5 Jun 2013 20:15:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r251433 - head/bin/sleep X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 05 Jun 2013 20:15:19 -0000 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. */