From 137a41351e834e4ca98edbfdb40c4726dc3d2f04 Mon Sep 17 00:00:00 2001 From: Johan Hedberg Date: Sun, 21 Jan 2007 23:48:20 +0000 Subject: Fix g_spawn_async error reporting --- eglib/gmain.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/eglib/gmain.c b/eglib/gmain.c index 0a42f1b9..8375cd9a 100644 --- a/eglib/gmain.c +++ b/eglib/gmain.c @@ -759,8 +759,10 @@ gboolean g_spawn_async(const gchar *working_directory, { GPid pid; - if (access(argv[0], X_OK) < 0) + if (access(argv[0], X_OK) < 0) { + g_set_error(error, 0, 0, "%s is not executable", argv[0]); return FALSE; + } if (child_watch_pipe[0] < 0) init_child_pipe(); @@ -770,6 +772,7 @@ gboolean g_spawn_async(const gchar *working_directory, switch (pid = fork()) { case -1: + g_set_error(error, 0, 0, "fork failed: %s", strerror(errno)); return FALSE; case 0: exec_child(working_directory, argv, envp, flags, @@ -781,6 +784,7 @@ gboolean g_spawn_async(const gchar *working_directory, return TRUE; } + /* Never reached */ return FALSE; } -- cgit