summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTor Lillqvist <tml@iki.fi>2004-11-30 02:23:54 +0000
committerTor Lillqvist <tml@src.gnome.org>2004-11-30 02:23:54 +0000
commit0dec9146a0f03803e716d8d71ff670529c1ae002 (patch)
treea78e217855617795d4ac45fd072d86aa471954b0
parent60d2a933975ad434edfea7aa2c616dd442aa386e (diff)
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)
-rw-r--r--ChangeLog5
-rw-r--r--ChangeLog.pre-2-105
-rw-r--r--ChangeLog.pre-2-125
-rw-r--r--ChangeLog.pre-2-65
-rw-r--r--ChangeLog.pre-2-85
-rw-r--r--glib/gspawn-win32-helper.c5
6 files changed, 29 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index 63536ff75..f5bf1782c 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -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-08 Matthias Clasen <mclasen@redhat.com>
* glib/gmain.c: Initialize child_watch_count to 1, so
diff --git a/ChangeLog.pre-2-10 b/ChangeLog.pre-2-10
index 63536ff75..f5bf1782c 100644
--- a/ChangeLog.pre-2-10
+++ b/ChangeLog.pre-2-10
@@ -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-08 Matthias Clasen <mclasen@redhat.com>
* glib/gmain.c: Initialize child_watch_count to 1, so
diff --git a/ChangeLog.pre-2-12 b/ChangeLog.pre-2-12
index 63536ff75..f5bf1782c 100644
--- a/ChangeLog.pre-2-12
+++ b/ChangeLog.pre-2-12
@@ -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-08 Matthias Clasen <mclasen@redhat.com>
* glib/gmain.c: Initialize child_watch_count to 1, so
diff --git a/ChangeLog.pre-2-6 b/ChangeLog.pre-2-6
index 63536ff75..f5bf1782c 100644
--- a/ChangeLog.pre-2-6
+++ b/ChangeLog.pre-2-6
@@ -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-08 Matthias Clasen <mclasen@redhat.com>
* glib/gmain.c: Initialize child_watch_count to 1, so
diff --git a/ChangeLog.pre-2-8 b/ChangeLog.pre-2-8
index 63536ff75..f5bf1782c 100644
--- a/ChangeLog.pre-2-8
+++ b/ChangeLog.pre-2-8
@@ -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-08 Matthias Clasen <mclasen@redhat.com>
* glib/gmain.c: Initialize child_watch_count to 1, so
diff --git a/glib/gspawn-win32-helper.c b/glib/gspawn-win32-helper.c
index 5a2c9106b..1e34aab71 100644
--- a/glib/gspawn-win32-helper.c
+++ b/glib/gspawn-win32-helper.c
@@ -74,6 +74,7 @@ WinMain (struct HINSTANCE__ *hInstance,
int fd;
int mode;
int handle;
+ int saved_errno;
int no_error = CHILD_NO_ERROR;
int zero = 0;
gint file_and_argv_zero = 0;
@@ -240,6 +241,8 @@ WinMain (struct HINSTANCE__ *hInstance,
else
handle = spawnv (mode, __argv[ARG_PROGRAM], new_argv + ARG_PROGRAM + file_and_argv_zero);
+ saved_errno = errno;
+
if (debug)
{
debugstring = g_string_new (NULL);
@@ -251,7 +254,7 @@ WinMain (struct HINSTANCE__ *hInstance,
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 (child_err_report_fd, &no_error, sizeof (no_error));