From 5ee7e9ab6474d3837375c7093405fec6c5298249 Mon Sep 17 00:00:00 2001 From: Wesley Moore Date: Fri, 23 Oct 2020 18:06:11 +1100 Subject: [PATCH] rm: Exit with status 0 if stat fails and force is set --- Userland/rm.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Userland/rm.cpp b/Userland/rm.cpp index 7cd575f198..087f855ece 100644 --- a/Userland/rm.cpp +++ b/Userland/rm.cpp @@ -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) {