mirror of
https://github.com/RGBCube/serenity
synced 2025-05-14 09:14:58 +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)
|
||||
{
|
||||
if (unlink(pathname) < 0 && errno == EISDIR)
|
||||
return rmdir(pathname);
|
||||
if (unlink(pathname) < 0) {
|
||||
if (errno == EISDIR)
|
||||
return rmdir(pathname);
|
||||
return -1;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue