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