Date: Tue, 28 May 2013 22:07:32 +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: r251078 - head/bin/sleep Message-ID: <201305282207.r4SM7We8065840@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: jilles Date: Tue May 28 22:07:31 2013 New Revision: 251078 URL: http://svnweb.freebsd.org/changeset/base/251078 Log: sleep: Improve nanosleep() error handling: * Work around kernel bugs that cause a spurious [EINTR] return if a debugger (such as truss(1)) is attached. * Write an error message if an error other than [EINTR] occurs. PR: bin/178664 Modified: head/bin/sleep/sleep.c Modified: head/bin/sleep/sleep.c ============================================================================== --- head/bin/sleep/sleep.c Tue May 28 22:07:23 2013 (r251077) +++ head/bin/sleep/sleep.c Tue May 28 22:07:31 2013 (r251078) @@ -43,6 +43,7 @@ __FBSDID("$FreeBSD$"); #include <ctype.h> #include <err.h> +#include <errno.h> #include <limits.h> #include <signal.h> #include <stdint.h> @@ -87,8 +88,8 @@ main(int argc, char *argv[]) warnx("about %d second(s) left out of the original %d", (int)time_to_sleep.tv_sec, (int)original); report_requested = 0; - } else - break; + } else if (errno != EINTR) + err(1, "nanosleep"); } return (0); }
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201305282207.r4SM7We8065840>