From 16013c560e189bd0c4fb58e038c0f449542dba7a Mon Sep 17 00:00:00 2001 From: Laurent Bercot Date: Sun, 16 Jul 2017 11:19:51 +0000 Subject: Add egidingroups sysdeps, change fd_close() to void and saving errno, propagate changes --- src/libstddjb/fd_close.c | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) (limited to 'src/libstddjb/fd_close.c') diff --git a/src/libstddjb/fd_close.c b/src/libstddjb/fd_close.c index cb52d4f..a3c7880 100644 --- a/src/libstddjb/fd_close.c +++ b/src/libstddjb/fd_close.c @@ -4,12 +4,9 @@ #include #include -int fd_close (int fd) +void fd_close (int fd) { - for (;;) - { - if (!close(fd) || errno == EINPROGRESS) break ; - if (errno != EINTR) return -1 ; - } - return 0 ; + int e = errno ; + while (close(fd) < 0 && errno == EINTR) ; + errno = e ; } -- cgit v1.2.3