fix handling of EINTR during close()
[musl] / src / unistd / close.c
index 728d729..e8f813d 100644 (file)
@@ -1,8 +1,11 @@
 #include <unistd.h>
 #include <unistd.h>
+#include <errno.h>
 #include "syscall.h"
 #include "libc.h"
 
 int close(int fd)
 {
 #include "syscall.h"
 #include "libc.h"
 
 int close(int fd)
 {
-       return syscall_cp(SYS_close, fd);
+       int r = __syscall_cp(SYS_close, fd);
+       if (r == -EINTR) r = -EINPROGRESS;
+       return __syscall_ret(r);
 }
 }