fix messed-up errno if remove fails for a non-EISDIR reason
This commit is contained in:
parent
0b240ccf52
commit
9646e4d024
1 changed files with 2 additions and 2 deletions
|
|
@ -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;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue