From 0a1f654c201bab8b76d46fb58453e3a64c01c9a2 Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Tue, 26 Aug 2008 15:44:55 +0200 Subject: call close() in a loop to catch EINTR --- src/pulsecore/core-util.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/pulsecore/core-util.c b/src/pulsecore/core-util.c index 89416d8b..c78e8fd7 100644 --- a/src/pulsecore/core-util.c +++ b/src/pulsecore/core-util.c @@ -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 -- cgit