From: Pádraig Brady Date: Thu, 1 Sep 2011 14:30:18 +0000 (+0100) Subject: timeout: suppress a redundant warning on some systems X-Git-Tag: v8.13~17 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=38e3a90e4b83c4b8642c8421f8237b32bfb27355;p=thirdparty%2Fcoreutils.git 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 --- diff --git a/src/timeout.c b/src/timeout.c index ae899420b8..fd19d1266f 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