mirror of
https://github.com/opnsense/src.git
synced 2026-06-09 00:32:25 -04:00
Hack^H^H^H^Hworkaround for itimerfix(9) gratuitously limiting the
acceptable range for tv_sec to the magic number 100000000 (which at least ought to be declared in a header file, and explained in the non-existing man page, as well as in the existing man pages for nanosleep(2) & Co.). PR: bin/4259
This commit is contained in:
parent
66319037c9
commit
ac77b4810d
1 changed files with 16 additions and 0 deletions
|
|
@ -60,6 +60,14 @@ sleep(seconds)
|
|||
struct timespec time_remaining;
|
||||
|
||||
if (seconds != 0) {
|
||||
/*
|
||||
* XXX
|
||||
* Hack to work around itimerfix(9) gratuitously limiting
|
||||
* the acceptable range for a struct timeval.tv_sec to
|
||||
* <= 100000000.
|
||||
*/
|
||||
if (seconds > 100000000)
|
||||
seconds = 100000000;
|
||||
time_to_sleep.tv_sec = seconds;
|
||||
time_to_sleep.tv_nsec = 0;
|
||||
nanosleep(&time_to_sleep, &time_remaining);
|
||||
|
|
@ -75,6 +83,14 @@ sleep(seconds)
|
|||
sigset_t mask, omask;
|
||||
|
||||
if (seconds != 0) {
|
||||
/*
|
||||
* XXX
|
||||
* Hack to work around itimerfix(9) gratuitously limiting
|
||||
* the acceptable range for a struct timeval.tv_sec to
|
||||
* <= 100000000.
|
||||
*/
|
||||
if (seconds > 100000000)
|
||||
seconds = 100000000;
|
||||
time_to_sleep.tv_sec = seconds;
|
||||
time_to_sleep.tv_nsec = 0;
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue