diff options
author | Pádraig Brady <P@draigBrady.com> | 2011-09-01 15:30:18 +0100 |
---|---|---|
committer | Pádraig Brady <P@draigBrady.com> | 2011-09-01 15:30:18 +0100 |
commit | 38e3a90e4b83c4b8642c8421f8237b32bfb27355 (patch) | |
tree | 1b7b6a470382928d9cacd17476edc85d3dc18ba9 | |
parent | 197cd0994d93ea650efb86a4290e09a0fc63384f (diff) | |
download | coreutils-38e3a90e4b83c4b8642c8421f8237b32bfb27355.tar.xz |
timeout: suppress a redundant warning on some systems
* src/timeout.c (settimeout): Don't warn about ENOSYS
which is returned on OpenBSD 4.9 at least.
Reported by Bruno Haible
-rw-r--r-- | src/timeout.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/timeout.c b/src/timeout.c index ae899420b..fd19d1266 100644 --- a/src/timeout.c +++ b/src/timeout.c @@ -116,7 +116,8 @@ settimeout (double duration) struct timespec ts = dtotimespec (duration); struct itimerspec its = { {0, 0}, ts }; timer_t timerid; - if (timer_create (CLOCK_REALTIME, NULL, &timerid) == 0) + int timer_ret = timer_create (CLOCK_REALTIME, NULL, &timerid); + if (timer_ret == 0) { if (timer_settime (timerid, 0, &its, NULL) == 0) return; @@ -126,7 +127,7 @@ settimeout (double duration) timer_delete (timerid); } } - else + else if (timer_ret != ENOSYS) error (0, errno, _("warning: timer_create")); #endif |