X-Git-Url: http://nsz.repo.hu/git/?p=musl;a=blobdiff_plain;f=src%2Fstdio%2Fremove.c;h=e147ba251440d8e04d8585604c8190891b1643ac;hp=8e338277eb967dcbac1f76f8d8994f8b47b8f668;hb=HEAD;hpb=0b44a0315b47dd8eced9f3b7f31580cf14bbfc01 diff --git a/src/stdio/remove.c b/src/stdio/remove.c index 8e338277..e147ba25 100644 --- a/src/stdio/remove.c +++ b/src/stdio/remove.c @@ -1,7 +1,9 @@ #include +#include #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; }