1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 19:07:35 +00:00

rm: Exit with status 0 if stat fails and force is set

This commit is contained in:
Wesley Moore 2020-10-23 18:06:11 +11:00 committed by Andreas Kling
parent 46c15276e9
commit 5ee7e9ab64

View file

@ -41,7 +41,7 @@ static int remove(bool recursive, bool force, String path)
if (lstat(path.characters(), &path_stat) < 0) {
if (!force)
perror("lstat");
return 1;
return force ? 0 : 1;
}
if (S_ISDIR(path_stat.st_mode) && recursive) {