Also check errno to detect true errors from spawn*(). (#157258, reported

2004-11-30  Tor Lillqvist  <tml@iki.fi>

	* glib/gspawn-win32-helper.c (WinMain): Also check errno to detect
	true errors from spawn*(). (#157258, reported by Bruce Hochstetler)
This commit is contained in:
Tor Lillqvist 2004-11-30 02:27:22 +00:00 committed by Tor Lillqvist
parent c0e53a2132
commit 8751cc5c26
6 changed files with 29 additions and 1 deletions

View File

@ -1,3 +1,8 @@
2004-11-30 Tor Lillqvist <tml@iki.fi>
* glib/gspawn-win32-helper.c (WinMain): Also check errno to detect
true errors from spawn*(). (#157258, reported by Bruce Hochstetler)
2004-11-29 Matthias Clasen <mclasen@redhat.com> 2004-11-29 Matthias Clasen <mclasen@redhat.com>
* glib/gmacros.h (G_GNUC_MALLOC): Define empty for gcc 2.95. * glib/gmacros.h (G_GNUC_MALLOC): Define empty for gcc 2.95.

View File

@ -1,3 +1,8 @@
2004-11-30 Tor Lillqvist <tml@iki.fi>
* glib/gspawn-win32-helper.c (WinMain): Also check errno to detect
true errors from spawn*(). (#157258, reported by Bruce Hochstetler)
2004-11-29 Matthias Clasen <mclasen@redhat.com> 2004-11-29 Matthias Clasen <mclasen@redhat.com>
* glib/gmacros.h (G_GNUC_MALLOC): Define empty for gcc 2.95. * glib/gmacros.h (G_GNUC_MALLOC): Define empty for gcc 2.95.

View File

@ -1,3 +1,8 @@
2004-11-30 Tor Lillqvist <tml@iki.fi>
* glib/gspawn-win32-helper.c (WinMain): Also check errno to detect
true errors from spawn*(). (#157258, reported by Bruce Hochstetler)
2004-11-29 Matthias Clasen <mclasen@redhat.com> 2004-11-29 Matthias Clasen <mclasen@redhat.com>
* glib/gmacros.h (G_GNUC_MALLOC): Define empty for gcc 2.95. * glib/gmacros.h (G_GNUC_MALLOC): Define empty for gcc 2.95.

View File

@ -1,3 +1,8 @@
2004-11-30 Tor Lillqvist <tml@iki.fi>
* glib/gspawn-win32-helper.c (WinMain): Also check errno to detect
true errors from spawn*(). (#157258, reported by Bruce Hochstetler)
2004-11-29 Matthias Clasen <mclasen@redhat.com> 2004-11-29 Matthias Clasen <mclasen@redhat.com>
* glib/gmacros.h (G_GNUC_MALLOC): Define empty for gcc 2.95. * glib/gmacros.h (G_GNUC_MALLOC): Define empty for gcc 2.95.

View File

@ -1,3 +1,8 @@
2004-11-30 Tor Lillqvist <tml@iki.fi>
* glib/gspawn-win32-helper.c (WinMain): Also check errno to detect
true errors from spawn*(). (#157258, reported by Bruce Hochstetler)
2004-11-29 Matthias Clasen <mclasen@redhat.com> 2004-11-29 Matthias Clasen <mclasen@redhat.com>
* glib/gmacros.h (G_GNUC_MALLOC): Define empty for gcc 2.95. * glib/gmacros.h (G_GNUC_MALLOC): Define empty for gcc 2.95.

View File

@ -74,6 +74,7 @@ WinMain (struct HINSTANCE__ *hInstance,
int fd; int fd;
int mode; int mode;
int handle; int handle;
int saved_errno;
int no_error = CHILD_NO_ERROR; int no_error = CHILD_NO_ERROR;
int zero = 0; int zero = 0;
gint file_and_argv_zero = 0; gint file_and_argv_zero = 0;
@ -240,6 +241,8 @@ WinMain (struct HINSTANCE__ *hInstance,
else else
handle = spawnv (mode, __argv[ARG_PROGRAM], new_argv + ARG_PROGRAM + file_and_argv_zero); handle = spawnv (mode, __argv[ARG_PROGRAM], new_argv + ARG_PROGRAM + file_and_argv_zero);
saved_errno = errno;
if (debug) if (debug)
{ {
debugstring = g_string_new (NULL); debugstring = g_string_new (NULL);
@ -251,7 +254,7 @@ WinMain (struct HINSTANCE__ *hInstance,
MessageBox (NULL, debugstring->str, "gspawn-win32-helper", 0); MessageBox (NULL, debugstring->str, "gspawn-win32-helper", 0);
} }
if (handle < 0) if (handle == -1 && saved_errno != 0)
write_err_and_exit (child_err_report_fd, CHILD_SPAWN_FAILED); write_err_and_exit (child_err_report_fd, CHILD_SPAWN_FAILED);
write (child_err_report_fd, &no_error, sizeof (no_error)); write (child_err_report_fd, &no_error, sizeof (no_error));