rework langinfo code for ABI compat and for use by time code
[musl] / src / stdio / remove.c
index 8e33827..e147ba2 100644 (file)
@@ -1,7 +1,9 @@
 #include <stdio.h>
+#include <errno.h>
 #include "syscall.h"
 
 int remove(const char *path)
 {
-       return __syscall_unlink(path);
+       int r = syscall(SYS_unlink, path);
+       return (r && errno == EISDIR) ? syscall(SYS_rmdir, path) : r;
 }