1
Fork 0
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:
Andreas Kling 2021-09-09 21:49:10 +02:00
parent 1864b2b828
commit c93687c15e

View file

@ -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;
} }