From 3d2e55d5083ba894f7b273db427f72dc40c58d32 Mon Sep 17 00:00:00 2001
From: Pádraig Brady <P@draigBrady.com>
Date: Thu, 1 Sep 2011 15:50:08 +0100
Subject: timeout: fixup previous warning fix

* src/timeout.c (settimeout): Fix the previous commit
to test errno rather than the return value.
---
 src/timeout.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

(limited to 'src')

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
 
-- 
cgit v1.2.3-70-g09d2