1
0
mirror of git://git.sv.gnu.org/coreutils.git synced 2026-04-20 18:56:39 +02:00

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
This commit is contained in:
Pádraig Brady
2011-09-01 15:30:18 +01:00
parent 197cd0994d
commit 38e3a90e4b

View File

@@ -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