From 11dd17db1799cfc2defe59571b62b628e0a6eee6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pa=CC=84vels=20Nadtoc=CC=8Cajevs?= <7645683+bruvzg@users.noreply.github.com> Date: Thu, 12 Mar 2026 11:56:12 +0200 Subject: [PATCH] Improve `OS.is_process_running` error messages. --- drivers/unix/os_unix.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/unix/os_unix.cpp b/drivers/unix/os_unix.cpp index 6bcda17854..8079490f6f 100644 --- a/drivers/unix/os_unix.cpp +++ b/drivers/unix/os_unix.cpp @@ -857,8 +857,8 @@ bool OS_Unix::_check_pid_is_running(const pid_t p_pid, int *r_status) const { // Thread is still running. return true; } - - ERR_FAIL_COND_V_MSG(result != 0, false, vformat("Thread %d exited with errno: %d", (int)p_pid, errno)); + ERR_FAIL_COND_V_MSG(result != 0 && errno == ECHILD, false, vformat("The process %d does not exist or is not a child of the calling process.", (int)p_pid)); + ERR_FAIL_COND_V_MSG(result != 0, false, vformat("waitpid for process %d failed with errno: %d", (int)p_pid, errno)); // Thread exited normally. status = WIFEXITED(status) ? WEXITSTATUS(status) : status;