-respect vfork semantics
authorChristian Grothoff <christian@grothoff.org>
Mon, 17 Dec 2012 10:54:41 +0000 (10:54 +0000)
committerChristian Grothoff <christian@grothoff.org>
Mon, 17 Dec 2012 10:54:41 +0000 (10:54 +0000)
src/util/os_priority.c

index c773c23995aadf4d9daee3ce891b0fa22df34e2a..ba2034c891cbcd1f009f355599817afa8601710a 100644 (file)
@@ -931,7 +931,10 @@ start_process (int pipe_control,
   if (NULL != childpipename)
   {
     setenv (GNUNET_OS_CONTROL_PIPE, childpipename, 1);
+#ifndef DARWIN
+    /* due to vfork, we must NOT free memory on DARWIN! */
     GNUNET_free (childpipename);
+#endif
   }
   if (NULL != pipe_stdin)
   {
@@ -1004,7 +1007,10 @@ start_process (int pipe_control,
     GNUNET_snprintf (fds, sizeof (fds), "%u", i);
     setenv ("LISTEN_FDS", fds, 1);
   }
+#ifndef DARWIN
+  /* due to vfork, we must NOT free memory on DARWIN! */
   GNUNET_array_grow (lscp, ls, 0);
+#endif
   execvp (filename, argv);
   LOG_STRERROR_FILE (GNUNET_ERROR_TYPE_ERROR, "execvp", filename);
   _exit (1);