summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog10
-rw-r--r--ChangeLog.pre-2-1010
-rw-r--r--ChangeLog.pre-2-1210
-rw-r--r--ChangeLog.pre-2-410
-rw-r--r--ChangeLog.pre-2-610
-rw-r--r--ChangeLog.pre-2-810
-rw-r--r--glib/gspawn.c35
7 files changed, 89 insertions, 6 deletions
diff --git a/ChangeLog b/ChangeLog
index ab2226ddb..565fb8f66 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,13 @@
+Mon Jun 2 14:18:21 2003 Owen Taylor <otaylor@redhat.com>
+
+ Patch from Jeffrey Stedfast <fejj@ximian.com> (#104825)
+
+ * glib/gspawn.c (read_data): Don't read() into '&buf', while this
+ is technically okay - it is clearer as just 'buf'.
+ (write_all): New helper function that handles write() interrupts.
+ (write_err_and_exit): Use write_all() instead of write().
+ (fork_exec_with_pipes): Same here.
+
Sun Jun 1 09:42:36 2003 Owen Taylor <otaylor@redhat.com>
* glib/giochannel.c (g_io_error_get_from_g_error): Put
diff --git a/ChangeLog.pre-2-10 b/ChangeLog.pre-2-10
index ab2226ddb..565fb8f66 100644
--- a/ChangeLog.pre-2-10
+++ b/ChangeLog.pre-2-10
@@ -1,3 +1,13 @@
+Mon Jun 2 14:18:21 2003 Owen Taylor <otaylor@redhat.com>
+
+ Patch from Jeffrey Stedfast <fejj@ximian.com> (#104825)
+
+ * glib/gspawn.c (read_data): Don't read() into '&buf', while this
+ is technically okay - it is clearer as just 'buf'.
+ (write_all): New helper function that handles write() interrupts.
+ (write_err_and_exit): Use write_all() instead of write().
+ (fork_exec_with_pipes): Same here.
+
Sun Jun 1 09:42:36 2003 Owen Taylor <otaylor@redhat.com>
* glib/giochannel.c (g_io_error_get_from_g_error): Put
diff --git a/ChangeLog.pre-2-12 b/ChangeLog.pre-2-12
index ab2226ddb..565fb8f66 100644
--- a/ChangeLog.pre-2-12
+++ b/ChangeLog.pre-2-12
@@ -1,3 +1,13 @@
+Mon Jun 2 14:18:21 2003 Owen Taylor <otaylor@redhat.com>
+
+ Patch from Jeffrey Stedfast <fejj@ximian.com> (#104825)
+
+ * glib/gspawn.c (read_data): Don't read() into '&buf', while this
+ is technically okay - it is clearer as just 'buf'.
+ (write_all): New helper function that handles write() interrupts.
+ (write_err_and_exit): Use write_all() instead of write().
+ (fork_exec_with_pipes): Same here.
+
Sun Jun 1 09:42:36 2003 Owen Taylor <otaylor@redhat.com>
* glib/giochannel.c (g_io_error_get_from_g_error): Put
diff --git a/ChangeLog.pre-2-4 b/ChangeLog.pre-2-4
index ab2226ddb..565fb8f66 100644
--- a/ChangeLog.pre-2-4
+++ b/ChangeLog.pre-2-4
@@ -1,3 +1,13 @@
+Mon Jun 2 14:18:21 2003 Owen Taylor <otaylor@redhat.com>
+
+ Patch from Jeffrey Stedfast <fejj@ximian.com> (#104825)
+
+ * glib/gspawn.c (read_data): Don't read() into '&buf', while this
+ is technically okay - it is clearer as just 'buf'.
+ (write_all): New helper function that handles write() interrupts.
+ (write_err_and_exit): Use write_all() instead of write().
+ (fork_exec_with_pipes): Same here.
+
Sun Jun 1 09:42:36 2003 Owen Taylor <otaylor@redhat.com>
* glib/giochannel.c (g_io_error_get_from_g_error): Put
diff --git a/ChangeLog.pre-2-6 b/ChangeLog.pre-2-6
index ab2226ddb..565fb8f66 100644
--- a/ChangeLog.pre-2-6
+++ b/ChangeLog.pre-2-6
@@ -1,3 +1,13 @@
+Mon Jun 2 14:18:21 2003 Owen Taylor <otaylor@redhat.com>
+
+ Patch from Jeffrey Stedfast <fejj@ximian.com> (#104825)
+
+ * glib/gspawn.c (read_data): Don't read() into '&buf', while this
+ is technically okay - it is clearer as just 'buf'.
+ (write_all): New helper function that handles write() interrupts.
+ (write_err_and_exit): Use write_all() instead of write().
+ (fork_exec_with_pipes): Same here.
+
Sun Jun 1 09:42:36 2003 Owen Taylor <otaylor@redhat.com>
* glib/giochannel.c (g_io_error_get_from_g_error): Put
diff --git a/ChangeLog.pre-2-8 b/ChangeLog.pre-2-8
index ab2226ddb..565fb8f66 100644
--- a/ChangeLog.pre-2-8
+++ b/ChangeLog.pre-2-8
@@ -1,3 +1,13 @@
+Mon Jun 2 14:18:21 2003 Owen Taylor <otaylor@redhat.com>
+
+ Patch from Jeffrey Stedfast <fejj@ximian.com> (#104825)
+
+ * glib/gspawn.c (read_data): Don't read() into '&buf', while this
+ is technically okay - it is clearer as just 'buf'.
+ (write_all): New helper function that handles write() interrupts.
+ (write_err_and_exit): Use write_all() instead of write().
+ (fork_exec_with_pipes): Same here.
+
Sun Jun 1 09:42:36 2003 Owen Taylor <otaylor@redhat.com>
* glib/giochannel.c (g_io_error_get_from_g_error): Put
diff --git a/glib/gspawn.c b/glib/gspawn.c
index 2af786db4..77d44fb2d 100644
--- a/glib/gspawn.c
+++ b/glib/gspawn.c
@@ -148,7 +148,7 @@ read_data (GString *str,
again:
- bytes = read (fd, &buf, 4096);
+ bytes = read (fd, buf, 4096);
if (bytes == 0)
return READ_EOF;
@@ -793,13 +793,36 @@ exec_err_to_g_error (gint en)
}
}
+static gssize
+write_all (gint fd, gconstpointer vbuf, gsize to_write)
+{
+ gchar *buf = (gchar *) vbuf;
+
+ while (to_write > 0)
+ {
+ gssize count = write (fd, buf, to_write);
+ if (count < 0)
+ {
+ if (errno != EINTR)
+ return FALSE;
+ }
+ else
+ {
+ to_write -= count;
+ buf += count;
+ }
+ }
+
+ return TRUE;
+}
+
static void
write_err_and_exit (gint fd, gint msg)
{
gint en = errno;
- write (fd, &msg, sizeof(msg));
- write (fd, &en, sizeof(en));
+ write_all (fd, &msg, sizeof(msg));
+ write_all (fd, &en, sizeof(en));
_exit (1);
}
@@ -1081,8 +1104,8 @@ fork_exec_with_pipes (gboolean intermediate_child,
if (grandchild_pid < 0)
{
/* report -1 as child PID */
- write (child_pid_report_pipe[1], &grandchild_pid,
- sizeof(grandchild_pid));
+ write_all (child_pid_report_pipe[1], &grandchild_pid,
+ sizeof(grandchild_pid));
write_err_and_exit (child_err_report_pipe[1],
CHILD_FORK_FAILED);
@@ -1107,7 +1130,7 @@ fork_exec_with_pipes (gboolean intermediate_child,
}
else
{
- write (child_pid_report_pipe[1], &grandchild_pid, sizeof(grandchild_pid));
+ write_all (child_pid_report_pipe[1], &grandchild_pid, sizeof(grandchild_pid));
close_and_invalidate (&child_pid_report_pipe[1]);
_exit (0);