X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=glib%2Fgspawn-win32.c;h=2acbde33c7d73c38503c2ea2ee2f3d8594011928;hb=9f5afe3966d31ef6f1e880d950206a0325e6c777;hp=44ae907ff0b6f04c4d86df40298af92d5ee89240;hpb=d8ca6404229e5b64d2bf2e1a3660ad9fe7feefdd;p=platform%2Fupstream%2Fglib.git diff --git a/glib/gspawn-win32.c b/glib/gspawn-win32.c index 44ae907..2acbde3 100644 --- a/glib/gspawn-win32.c +++ b/glib/gspawn-win32.c @@ -45,8 +45,10 @@ #include "config.h" #include "glib.h" +#include "glib-private.h" #include "gprintfint.h" #include "glibintl.h" +#include "gthread.h" #include #include @@ -60,6 +62,7 @@ #include #include +#ifndef GSPAWN_HELPER #ifdef G_SPAWN_WIN32_DEBUG static int debug = 1; #define SETUP_DEBUG() /* empty */ @@ -78,6 +81,7 @@ } \ G_STMT_END #endif +#endif enum { @@ -205,11 +209,8 @@ protect_argv (gchar **argv, return argc; } -GQuark -g_spawn_error_quark (void) -{ - return g_quark_from_static_string ("g-exec-error-quark"); -} +G_DEFINE_QUARK (g-exec-error-quark, g_spawn_error) +G_DEFINE_QUARK (g-spawn-exit-error-quark, g_spawn_exit_error) gboolean g_spawn_async_utf8 (const gchar *working_directory, @@ -547,7 +548,6 @@ do_spawn_with_pipes (gint *exit_status, gchar *helper_process; CONSOLE_CURSOR_INFO cursor_info; wchar_t *whelper, **wargv, **wenvp; - extern gchar *_glib_get_dll_directory (void); gchar *glib_dll_directory; if (child_setup && !warned_about_child_setup) @@ -1221,6 +1221,25 @@ g_spawn_close_pid (GPid pid) CloseHandle (pid); } +gboolean +g_spawn_check_exit_status (gint exit_status, + GError **error) +{ + gboolean ret = FALSE; + + if (exit_status != 0) + { + g_set_error (error, G_SPAWN_EXIT_ERROR, exit_status, + _("Child process exited with code %ld"), + (long) exit_status); + goto out; + } + + ret = TRUE; + out: + return ret; +} + #if !defined (_WIN64) /* Binary compatibility versions that take system codepage pathnames,