mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-01-12 23:46:17 +01:00
Close the process handle if the called doesn't want it also in the case
2005-03-20 Tor Lillqvist <tml@novell.com> * glib/gspawn-win32.c (do_spawn_with_pipes): Close the process handle if the called doesn't want it also in the case without a helper process. (g_spawn_sync): Don't ask for a child pid which we don't need.
This commit is contained in:
parent
86a32e7dc0
commit
c8237ec1cd
@ -1,5 +1,10 @@
|
|||||||
2005-03-20 Tor Lillqvist <tml@novell.com>
|
2005-03-20 Tor Lillqvist <tml@novell.com>
|
||||||
|
|
||||||
|
* glib/gspawn-win32.c (do_spawn_with_pipes): Close the process
|
||||||
|
handle if the called doesn't want it also in the case without a
|
||||||
|
helper process.
|
||||||
|
(g_spawn_sync): Don't ask for a child pid which we don't need.
|
||||||
|
|
||||||
* glib/gtimer.c: On Win32, use GetSystemTimeAsFileTime() instead
|
* glib/gtimer.c: On Win32, use GetSystemTimeAsFileTime() instead
|
||||||
of GetTickCount(). (#159507)
|
of GetTickCount(). (#159507)
|
||||||
|
|
||||||
|
@ -1,5 +1,10 @@
|
|||||||
2005-03-20 Tor Lillqvist <tml@novell.com>
|
2005-03-20 Tor Lillqvist <tml@novell.com>
|
||||||
|
|
||||||
|
* glib/gspawn-win32.c (do_spawn_with_pipes): Close the process
|
||||||
|
handle if the called doesn't want it also in the case without a
|
||||||
|
helper process.
|
||||||
|
(g_spawn_sync): Don't ask for a child pid which we don't need.
|
||||||
|
|
||||||
* glib/gtimer.c: On Win32, use GetSystemTimeAsFileTime() instead
|
* glib/gtimer.c: On Win32, use GetSystemTimeAsFileTime() instead
|
||||||
of GetTickCount(). (#159507)
|
of GetTickCount(). (#159507)
|
||||||
|
|
||||||
|
@ -1,5 +1,10 @@
|
|||||||
2005-03-20 Tor Lillqvist <tml@novell.com>
|
2005-03-20 Tor Lillqvist <tml@novell.com>
|
||||||
|
|
||||||
|
* glib/gspawn-win32.c (do_spawn_with_pipes): Close the process
|
||||||
|
handle if the called doesn't want it also in the case without a
|
||||||
|
helper process.
|
||||||
|
(g_spawn_sync): Don't ask for a child pid which we don't need.
|
||||||
|
|
||||||
* glib/gtimer.c: On Win32, use GetSystemTimeAsFileTime() instead
|
* glib/gtimer.c: On Win32, use GetSystemTimeAsFileTime() instead
|
||||||
of GetTickCount(). (#159507)
|
of GetTickCount(). (#159507)
|
||||||
|
|
||||||
|
@ -1,5 +1,10 @@
|
|||||||
2005-03-20 Tor Lillqvist <tml@novell.com>
|
2005-03-20 Tor Lillqvist <tml@novell.com>
|
||||||
|
|
||||||
|
* glib/gspawn-win32.c (do_spawn_with_pipes): Close the process
|
||||||
|
handle if the called doesn't want it also in the case without a
|
||||||
|
helper process.
|
||||||
|
(g_spawn_sync): Don't ask for a child pid which we don't need.
|
||||||
|
|
||||||
* glib/gtimer.c: On Win32, use GetSystemTimeAsFileTime() instead
|
* glib/gtimer.c: On Win32, use GetSystemTimeAsFileTime() instead
|
||||||
of GetTickCount(). (#159507)
|
of GetTickCount(). (#159507)
|
||||||
|
|
||||||
|
@ -444,9 +444,18 @@ do_spawn_with_pipes (gboolean dont_wait,
|
|||||||
goto cleanup_and_fail;
|
goto cleanup_and_fail;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (child_handle && dont_wait && !dont_return_handle)
|
if (dont_wait)
|
||||||
|
{
|
||||||
|
if (child_handle && !dont_return_handle)
|
||||||
*child_handle = (GPid) rc;
|
*child_handle = (GPid) rc;
|
||||||
else if (!dont_wait && exit_status)
|
else
|
||||||
|
{
|
||||||
|
CloseHandle (rc);
|
||||||
|
if (child_handle)
|
||||||
|
*child_handle = 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if (exit_status)
|
||||||
*exit_status = rc;
|
*exit_status = rc;
|
||||||
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
@ -685,7 +694,6 @@ g_spawn_sync (const gchar *working_directory,
|
|||||||
gint outpipe = -1;
|
gint outpipe = -1;
|
||||||
gint errpipe = -1;
|
gint errpipe = -1;
|
||||||
gint reportpipe = -1;
|
gint reportpipe = -1;
|
||||||
GPid pid;
|
|
||||||
GIOChannel *outchannel = NULL;
|
GIOChannel *outchannel = NULL;
|
||||||
GIOChannel *errchannel = NULL;
|
GIOChannel *errchannel = NULL;
|
||||||
GPollFD outfd, errfd;
|
GPollFD outfd, errfd;
|
||||||
@ -723,7 +731,7 @@ g_spawn_sync (const gchar *working_directory,
|
|||||||
flags,
|
flags,
|
||||||
child_setup,
|
child_setup,
|
||||||
user_data,
|
user_data,
|
||||||
&pid,
|
NULL,
|
||||||
NULL,
|
NULL,
|
||||||
standard_output ? &outpipe : NULL,
|
standard_output ? &outpipe : NULL,
|
||||||
standard_error ? &errpipe : NULL,
|
standard_error ? &errpipe : NULL,
|
||||||
@ -890,8 +898,6 @@ g_spawn_sync (const gchar *working_directory,
|
|||||||
if (errpipe >= 0)
|
if (errpipe >= 0)
|
||||||
close_and_invalidate (&errpipe);
|
close_and_invalidate (&errpipe);
|
||||||
|
|
||||||
g_spawn_close_pid (pid);
|
|
||||||
|
|
||||||
if (failed)
|
if (failed)
|
||||||
{
|
{
|
||||||
if (outstr)
|
if (outstr)
|
||||||
|
Loading…
Reference in New Issue
Block a user