fix broken regerror (typo) and missing message
[musl] / src / unistd / dup2.c
index 7945f85..87a0d44 100644 (file)
@@ -1,7 +1,10 @@
 #include <unistd.h>
+#include <errno.h>
 #include "syscall.h"
 
 int dup2(int old, int new)
 {
-       return syscall(SYS_dup2, old, new);
+       int r;
+       while ((r=__syscall(SYS_dup2, old, new))==-EBUSY);
+       return __syscall_ret(r);
 }