mirror of
https://github.com/fluencelabs/musl
synced 2025-06-25 04:31:56 +00:00
fix messed-up errno if remove fails for a non-EISDIR reason
This commit is contained in:
@ -4,6 +4,6 @@
|
|||||||
|
|
||||||
int remove(const char *path)
|
int remove(const char *path)
|
||||||
{
|
{
|
||||||
return (syscall(SYS_unlink, path) && errno == EISDIR)
|
int r = syscall(SYS_unlink, path);
|
||||||
? syscall(SYS_rmdir, path) : 0;
|
return (r && errno == EISDIR) ? syscall(SYS_rmdir, path) : r;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user