projects
/
oweals
/
musl.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
4106cdc
)
learned something new - remove is supposed to support directories on POSIX
author
Rich Felker
<dalias@aerifal.cx>
Tue, 29 Mar 2011 12:24:28 +0000
(08:24 -0400)
committer
Rich Felker
<dalias@aerifal.cx>
Tue, 29 Mar 2011 12:24:28 +0000
(08:24 -0400)
src/stdio/remove.c
patch
|
blob
|
history
diff --git
a/src/stdio/remove.c
b/src/stdio/remove.c
index 9e1de7f239f698aac83307c1034863fb902c1501..fc12f7c10578d2f2f05bb2e7a6753dbe626e2ed7 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);
+ return (syscall(SYS_unlink, path) && errno == EISDIR)
+ ? syscall(SYS_rmdir, path) : 0;
}