mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 12:38:12 +00:00
LibC: Make remove() propagate non-EISDIR unlink() errors
Regressed in 16105091ba
.
This commit is contained in:
parent
1864b2b828
commit
c93687c15e
1 changed files with 5 additions and 2 deletions
|
@ -1236,8 +1236,11 @@ int pclose(FILE* stream)
|
||||||
|
|
||||||
int remove(const char* pathname)
|
int remove(const char* pathname)
|
||||||
{
|
{
|
||||||
if (unlink(pathname) < 0 && errno == EISDIR)
|
if (unlink(pathname) < 0) {
|
||||||
return rmdir(pathname);
|
if (errno == EISDIR)
|
||||||
|
return rmdir(pathname);
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue