Use fork1() not fork for G_THREADS_IMPL_SOLARIS. (#136971, Sebastian
authorOwen Taylor <otaylor@redhat.com>
Sun, 14 Mar 2004 18:26:47 +0000 (18:26 +0000)
committerOwen Taylor <otaylor@src.gnome.org>
Sun, 14 Mar 2004 18:26:47 +0000 (18:26 +0000)
Sun Mar 14 13:23:36 2004  Owen Taylor  <otaylor@redhat.com>

        * glib/gspawn.c: Use fork1() not fork for
        G_THREADS_IMPL_SOLARIS. (#136971, Sebastian Wilhelmi)

ChangeLog
ChangeLog.pre-2-10
ChangeLog.pre-2-12
ChangeLog.pre-2-4
ChangeLog.pre-2-6
ChangeLog.pre-2-8
glib/gspawn.c

index c13000d..086aa83 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+Sun Mar 14 13:23:36 2004  Owen Taylor  <otaylor@redhat.com>
+
+       * glib/gspawn.c: Use fork1() not fork for 
+       G_THREADS_IMPL_SOLARIS. (#136971, Sebastian Wilhelmi)
+
 Sun Mar 14 12:58:30 2004  Owen Taylor  <otaylor@redhat.com>
 
        * glib/gmain.c: if _POLL_EMUL_H is defined, undefine
index c13000d..086aa83 100644 (file)
@@ -1,3 +1,8 @@
+Sun Mar 14 13:23:36 2004  Owen Taylor  <otaylor@redhat.com>
+
+       * glib/gspawn.c: Use fork1() not fork for 
+       G_THREADS_IMPL_SOLARIS. (#136971, Sebastian Wilhelmi)
+
 Sun Mar 14 12:58:30 2004  Owen Taylor  <otaylor@redhat.com>
 
        * glib/gmain.c: if _POLL_EMUL_H is defined, undefine
index c13000d..086aa83 100644 (file)
@@ -1,3 +1,8 @@
+Sun Mar 14 13:23:36 2004  Owen Taylor  <otaylor@redhat.com>
+
+       * glib/gspawn.c: Use fork1() not fork for 
+       G_THREADS_IMPL_SOLARIS. (#136971, Sebastian Wilhelmi)
+
 Sun Mar 14 12:58:30 2004  Owen Taylor  <otaylor@redhat.com>
 
        * glib/gmain.c: if _POLL_EMUL_H is defined, undefine
index c13000d..086aa83 100644 (file)
@@ -1,3 +1,8 @@
+Sun Mar 14 13:23:36 2004  Owen Taylor  <otaylor@redhat.com>
+
+       * glib/gspawn.c: Use fork1() not fork for 
+       G_THREADS_IMPL_SOLARIS. (#136971, Sebastian Wilhelmi)
+
 Sun Mar 14 12:58:30 2004  Owen Taylor  <otaylor@redhat.com>
 
        * glib/gmain.c: if _POLL_EMUL_H is defined, undefine
index c13000d..086aa83 100644 (file)
@@ -1,3 +1,8 @@
+Sun Mar 14 13:23:36 2004  Owen Taylor  <otaylor@redhat.com>
+
+       * glib/gspawn.c: Use fork1() not fork for 
+       G_THREADS_IMPL_SOLARIS. (#136971, Sebastian Wilhelmi)
+
 Sun Mar 14 12:58:30 2004  Owen Taylor  <otaylor@redhat.com>
 
        * glib/gmain.c: if _POLL_EMUL_H is defined, undefine
index c13000d..086aa83 100644 (file)
@@ -1,3 +1,8 @@
+Sun Mar 14 13:23:36 2004  Owen Taylor  <otaylor@redhat.com>
+
+       * glib/gspawn.c: Use fork1() not fork for 
+       G_THREADS_IMPL_SOLARIS. (#136971, Sebastian Wilhelmi)
+
 Sun Mar 14 12:58:30 2004  Owen Taylor  <otaylor@redhat.com>
 
        * glib/gmain.c: if _POLL_EMUL_H is defined, undefine
index d6adcd1..2fd31b8 100644 (file)
 
 #include "glibintl.h"
 
+/* With solaris threads, fork() duplicates all threads, which
+ * a) could cause unexpected side-effects, and b) is expensive.
+ * Once we remove support for solaris threads, the FORK1 #define
+ * should be removedl
+ */
+#ifdef G_THREADS_IMPL_SOLARIS
+#define FORK1() fork1()
+#else
+#define FORK1() fork()
+#endif
+
 static gint g_execute (const gchar  *file,
                        gchar **argv,
                        gchar **envp,
@@ -1056,7 +1067,7 @@ fork_exec_with_pipes (gboolean              intermediate_child,
   if (standard_error && !make_pipe (stderr_pipe, error))
     goto cleanup_and_fail;
 
-  pid = fork ();
+  pid = FORK1 ();
 
   if (pid < 0)
     {      
@@ -1098,7 +1109,7 @@ fork_exec_with_pipes (gboolean              intermediate_child,
            */
           GPid grandchild_pid;
 
-          grandchild_pid = fork ();
+          grandchild_pid = FORK1 ();
 
           if (grandchild_pid < 0)
             {