mirror of
https://git.savannah.gnu.org/git/coreutils.git
synced 2026-11-17 18:02:09 +03:00
timeout: fixup previous warning fix
* src/timeout.c (settimeout): Fix the previous commit to test errno rather than the return value.
This commit is contained in:
1 parent
37784220dd
commit
3d2e55d508
1 file changed
+2
-3
+2
-3
@@ -116,8 +116,7 @@ settimeout (double duration)
|
||||
struct timespec ts = dtotimespec (duration);
|
||||
struct itimerspec its = { {0, 0}, ts };
|
||||
timer_t timerid;
|
||||
int timer_ret = timer_create (CLOCK_REALTIME, NULL, &timerid);
|
||||
if (timer_ret == 0)
|
||||
if (timer_create (CLOCK_REALTIME, NULL, &timerid) == 0)
|
||||
{
|
||||
if (timer_settime (timerid, 0, &its, NULL) == 0)
|
||||
return;
|
||||
@@ -127,7 +126,7 @@ settimeout (double duration)
|
||||
timer_delete (timerid);
|
||||
}
|
||||
}
|
||||
else if (timer_ret != ENOSYS)
|
||||
else if (errno != ENOSYS)
|
||||
error (0, errno, _("warning: timer_create"));
|
||||
#endif
|
||||
|
||||
|
||||
Reference in new issue
Block a user