From 8e19d382cf2566ca5f46a5f9a5305f121e0f321a Mon Sep 17 00:00:00 2001 From: sfan5 Date: Sun, 4 Jan 2026 00:13:46 +0100 Subject: [PATCH] Make fs::RecursiveDelete() silent if nothing to do --- src/filesys.cpp | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/src/filesys.cpp b/src/filesys.cpp index cf22af8e09..2d551d7a57 100644 --- a/src/filesys.cpp +++ b/src/filesys.cpp @@ -363,16 +363,15 @@ bool IsExecutable(const std::string &path) bool RecursiveDelete(const std::string &path) { - /* - Execute the 'rm' command directly, by fork() and execve() - */ + assert(IsPathAbsolute(path)); + if (!PathExists(path)) + return true; + + // Execute the 'rm' command directly, by fork() and execve() infostream << "Removing \"" << path << "\"" << std::endl; - assert(IsPathAbsolute(path)); - const pid_t child_pid = fork(); - if (child_pid == -1) { errorstream << "fork errno: " << errno << ": " << strerror(errno) << std::endl;