projects
/
oweals
/
musl.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
| inline |
side by side
fix messed-up errno if remove fails for a non-EISDIR reason
[oweals/musl.git]
/
src
/
stdio
/
remove.c
diff --git
a/src/stdio/remove.c
b/src/stdio/remove.c
index fc12f7c10578d2f2f05bb2e7a6753dbe626e2ed7..e147ba251440d8e04d8585604c8190891b1643ac 100644
(file)
--- a/
src/stdio/remove.c
+++ b/
src/stdio/remove.c
@@
-4,6
+4,6
@@
int remove(const char *path)
{
- return (syscall(SYS_unlink, path) && errno == EISDIR)
-
? syscall(SYS_rmdir, path) : 0
;
+ int r = syscall(SYS_unlink, path);
+
return (r && errno == EISDIR) ? syscall(SYS_rmdir, path) : r
;
}