mirror of
https://git.kernel.org/pub/scm/bluetooth/bluez.git
synced 2024-11-17 09:14:32 +08:00
Fix g_spawn_async error reporting
This commit is contained in:
parent
ee8bf83b8a
commit
137a41351e
@ -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;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user