call close() in a loop to catch EINTR
authorLennart Poettering <lennart@poettering.net>
Tue, 26 Aug 2008 13:44:55 +0000 (15:44 +0200)
committerLennart Poettering <lennart@poettering.net>
Tue, 26 Aug 2008 13:44:55 +0000 (15:44 +0200)
src/pulsecore/core-util.c

index 89416d8..c78e8fd 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