Fix missing error check for fork() failing

This commit is contained in:
Campbell Barton
2024-08-22 17:08:14 +10:00
parent 7c3dcb114f
commit 6c82c039db

View File

@@ -1227,7 +1227,12 @@ static int delete_soft(const char *filepath, const char **error_message)
process_failed = "gio reported failure";
}
errno = 0;
int pid = fork();
if (UNLIKELY(pid == -1)) {
*error_message = errno ? strerror(errno) : "unable to fork process";
return -1;
}
if (pid != 0) {
/* Parent process. */