summaryrefslogtreecommitdiff
path: root/src/timeout.c
diff options
context:
space:
mode:
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