projects
/
musl
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
| inline |
side by side
use int instead of long for ptrdiff_t on all 32-bit archs
[musl]
/
src
/
stdio
/
remove.c
diff --git
a/src/stdio/remove.c
b/src/stdio/remove.c
index
9e1de7f
..
e147ba2
100644
(file)
--- a/
src/stdio/remove.c
+++ b/
src/stdio/remove.c
@@
-1,7
+1,9
@@
#include <stdio.h>
+#include <errno.h>
#include "syscall.h"
int remove(const char *path)
{
- return syscall(SYS_unlink, path);
+ int r = syscall(SYS_unlink, path);
+ return (r && errno == EISDIR) ? syscall(SYS_rmdir, path) : r;
}