ws_pipe: fix return value of ws_pipe_spawn_async on error path

The function returns a GPid, not a gboolean. Callers (mmdbresolv and
extcap) only assume WS_INVALID_PID to be invalid (as documented).

Change-Id: I40b491272a451f569864fa3259009d6d3fcce772
Fixes: v2.5.1rc0-413-g1a0987904f ("Generalize our process spawning code.")
Reviewed-on: https://code.wireshark.org/review/32933
Petri-Dish: Peter Wu <peter@lekensteyn.nl>
Tested-by: Petri Dish Buildbot
Reviewed-by: Tomasz Moń <desowin@gmail.com>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
This commit is contained in:
Peter Wu 2019-04-21 21:17:45 +01:00 committed by Anders Broman
parent c77ee0008d
commit 51ac1047a7
1 changed files with 3 additions and 3 deletions

View File

@ -498,7 +498,7 @@ GPid ws_pipe_spawn_async(ws_pipe_t *ws_pipe, GPtrArray *args)
if (!CreatePipe(&child_stdin_rd, &child_stdin_wr, &sa, 0))
{
g_log(LOG_DOMAIN_CAPTURE, G_LOG_LEVEL_DEBUG, "Could not create stdin handle");
return FALSE;
return WS_INVALID_PID;
}
if (!CreatePipe(&child_stdout_rd, &child_stdout_wr, &sa, 0))
@ -506,7 +506,7 @@ GPid ws_pipe_spawn_async(ws_pipe_t *ws_pipe, GPtrArray *args)
CloseHandle(child_stdin_rd);
CloseHandle(child_stdin_wr);
g_log(LOG_DOMAIN_CAPTURE, G_LOG_LEVEL_DEBUG, "Could not create stdout handle");
return FALSE;
return WS_INVALID_PID;
}
if (!CreatePipe(&child_stderr_rd, &child_stderr_wr, &sa, 0))
@ -516,7 +516,7 @@ GPid ws_pipe_spawn_async(ws_pipe_t *ws_pipe, GPtrArray *args)
CloseHandle(child_stdout_rd);
CloseHandle(child_stdout_wr);
g_log(LOG_DOMAIN_CAPTURE, G_LOG_LEVEL_DEBUG, "Could not create stderr handle");
return FALSE;
return WS_INVALID_PID;
}
spawn_args = g_string_sized_new(200);