pkstream/pkstream.c: Handle errors from select(2) properly.
authorMark Wooding <mdw@distorted.org.uk>
Wed, 27 Sep 2017 19:27:09 +0000 (20:27 +0100)
committerMark Wooding <mdw@distorted.org.uk>
Thu, 14 Jun 2018 09:34:25 +0000 (10:34 +0100)
pkstream/pkstream.c

index f03d0ff..4e565e0 100644 (file)
@@ -436,8 +436,10 @@ int main(int argc, char *argv[])
   } else
     dofwd(STDIN_FILENO, STDOUT_FILENO);
 
-  for (;;)
-    sel_select(&sel);
+  for (;;) {
+    if (sel_select(&sel) && errno != EINTR)
+      die(1, "select failed: %s", strerror(errno));
+  }
   return (0);
 }