summaryrefslogtreecommitdiff
path: root/src/timeout.c
diff options
context:
space:
mode:
authorPádraig Brady <P@draigBrady.com>2011-09-01 15:50:08 +0100
committerPádraig Brady <P@draigBrady.com>2011-09-01 15:50:08 +0100
commit3d2e55d5083ba894f7b273db427f72dc40c58d32 (patch)
tree7e018976ca10d898fb5dd97277e8d5d67bb98145 /src/timeout.c
parent37784220dd2a99201b532126f0b382206e860f07 (diff)
downloadcoreutils-3d2e55d5083ba894f7b273db427f72dc40c58d32.tar.gz
timeout: fixup previous warning fix
* src/timeout.c (settimeout): Fix the previous commit to test errno rather than the return value.
Diffstat (limited to 'src/timeout.c')
-rw-r--r--src/timeout.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/timeout.c b/src/timeout.c
index fd19d1266..d734e4e81 100644
--- a/src/timeout.c
+++ b/src/timeout.c
@@ -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