mirror of
https://github.com/freebsd/freebsd-src.git
synced 2024-11-27 13:32:45 +00:00
sleep: Explain in a comment why the [EINTR] check is there.
Suggested by: eadler
This commit is contained in:
parent
bd76c6b83f
commit
c6ef00e390
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=251433
@ -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. */
|
||||
|
Loading…
Reference in New Issue
Block a user