libdvbv5: Rewrite non portable select loop
authorGregor Jasny <gjasny@googlemail.com>
Mon, 18 Jun 2012 17:01:34 +0000 (19:01 +0200)
committerGregor Jasny <gjasny@googlemail.com>
Mon, 18 Jun 2012 17:35:08 +0000 (19:35 +0200)
Signed-off-by: Gregor Jasny <gjasny@googlemail.com>
lib/libdvbv5/dvb-scan.c

index e0a546c..f591f8e 100644 (file)
@@ -298,6 +298,7 @@ static int poll(int filedes, unsigned int seconds)
 {
        fd_set set;
        struct timeval timeout;
+       int ret;
 
        /* Initialize the file descriptor set. */
        FD_ZERO (&set);
@@ -308,9 +309,10 @@ static int poll(int filedes, unsigned int seconds)
        timeout.tv_usec = 0;
 
        /* `select' returns 0 if timeout, 1 if input available, -1 if error. */
-       return TEMP_FAILURE_RETRY (select (FD_SETSIZE,
-                                               &set, NULL, NULL,
-                                               &timeout));
+       do ret = select (FD_SETSIZE, &set, NULL, NULL, &timeout);
+       while (ret == -1 && errno == EINTR);
+
+       return ret;
 }