From c87d1bc0dc449ace9c0e178f43586ebffeeb33f5 Mon Sep 17 00:00:00 2001 From: Ross Lagerwall Date: Sat, 18 Oct 2014 13:13:00 +0100 Subject: [PATCH] Return exec errors correctly when spawning If an error happens when calling exec(), don't let the real errnum be overwritten by the babysitter's CHILD_EXIT status. Before, an exec error would show something like: Failed to execute program org.rossl.test: Success After: Failed to execute program org.rossl.test: No such file or directory --- dbus/dbus-spawn.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dbus/dbus-spawn.c b/dbus/dbus-spawn.c index b95cad6..f8b50ed 100644 --- a/dbus/dbus-spawn.c +++ b/dbus/dbus-spawn.c @@ -452,7 +452,7 @@ read_data (DBusBabysitter *sitter, if (got == 1) { - if (what == CHILD_EXITED) + if (what == CHILD_EXITED && !sitter->have_exec_errnum) { sitter->have_child_status = TRUE; sitter->status = arg; -- 2.1.2