X-Git-Url: http://nsz.repo.hu/git/?a=blobdiff_plain;f=src%2Fstdio%2Fremove.c;h=e147ba251440d8e04d8585604c8190891b1643ac;hb=b0302863a36ef6ad24bd25e3ef4df74b9a56980d;hp=8e338277eb967dcbac1f76f8d8994f8b47b8f668;hpb=0b44a0315b47dd8eced9f3b7f31580cf14bbfc01;p=musl 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; }