summaryrefslogtreecommitdiffstats
path: root/eglib
diff options
context:
space:
mode:
authorJohan Hedberg <johan.hedberg@nokia.com>2007-01-21 23:48:20 +0000
committerJohan Hedberg <johan.hedberg@nokia.com>2007-01-21 23:48:20 +0000
commit137a41351e834e4ca98edbfdb40c4726dc3d2f04 (patch)
tree16b55c1109c92165714adbfd01a05b38bf115695 /eglib
parentee8bf83b8add97ac50b73ec1a0e494a884b8937c (diff)
Fix g_spawn_async error reporting
Diffstat (limited to 'eglib')
-rw-r--r--eglib/gmain.c6
1 files changed, 5 insertions, 1 deletions
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;
}