]> code.delx.au - pulseaudio/blobdiff - src/pulsecore/core-util.c
call close() in a loop to catch EINTR
[pulseaudio] / src / pulsecore / core-util.c
index 89416d8b7464dd8698af89213f5aaed482854dad..c78e8fd7e3450dc41fb180eb9934aae25a1480f2 100644 (file)
@@ -398,7 +398,15 @@ int pa_close(int fd) {
     }
 #endif
 
-    return close(fd);
+    for (;;) {
+        int r;
+
+        if ((r = close(fd)) >= 0)
+            return r;
+
+        if (errno != EINTR)
+            return r;
+    }
 }
 
 /* Print a warning messages in case that the given signal is not