1
0
mirror of https://github.com/luanti-org/luanti.git synced 2026-01-14 13:25:21 +01:00

Make fs::RecursiveDelete() silent if nothing to do

This commit is contained in:
sfan5
2026-01-04 00:13:46 +01:00
parent 497d776851
commit 8e19d382cf

View File

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