From d62ad9dd47d368f7545c3cc91f44ecc07476d2e1 Mon Sep 17 00:00:00 2001 From: Roland Knall Date: Mon, 1 Aug 2016 16:57:51 +0200 Subject: [PATCH] extcap: Remove g_spawn_check_exit_status This function is not supported in the min GLIB version, therefore the code is to be removed Change-Id: Ie39170bfc0662e5a477cbc45d7eadebcf2c70d4e Reviewed-on: https://code.wireshark.org/review/16827 Petri-Dish: Roland Knall Reviewed-by: Dario Lombardo Tested-by: Petri Dish Buildbot Reviewed-by: Roland Knall --- extcap.c | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/extcap.c b/extcap.c index 7f67e1e1e1..103e8e0152 100644 --- a/extcap.c +++ b/extcap.c @@ -821,7 +821,6 @@ void extcap_child_watch_cb(GPid pid, gint status _U_, gpointer user_data) { guint i; interface_options interface_opts; - GError * error = 0; extcap_userdata * userdata = NULL; capture_options * capture_opts = (capture_options *)(user_data); @@ -842,8 +841,18 @@ void extcap_child_watch_cb(GPid pid, gint status _U_, gpointer user_data) { interface_opts.extcap_pid = INVALID_EXTCAP_PID; userdata->exitcode = 0; - if ( ! g_spawn_check_exit_status(status, &error) ) - userdata->exitcode = error->code; +#ifndef _WIN32 + if ( WIFEXITED(status) ) + { + if ( WEXITSTATUS(status) != 0 ) + userdata->exitcode = WEXITSTATUS(status); + } + else + userdata->exitcode = G_SPAWN_ERROR_FAILED; +#else + if (status != 0) + userdata->exitcode = status; +#endif if ( status == 0 && userdata->extcap_stderr != NULL ) userdata->exitcode = 1; }