The __gnat_in_child_after_fork flag was introduced for tracking memory
within a child process created by __gnat_expect_fork. It is not needed
for __gnat_portable_spawn, where fork is immediately followed by execv
(and _exit should execv fail), because there can be no memory
allocations between fork and execv/_exit.

Code cleanup only related to discussion about the use of fork, vfork and
posix_spawn in GNATprove.

Tested on x86_64-pc-linux-gnu, committed on trunk

gcc/ada/

        * adaint.c (__gnat_portable_spawn): Revert change that
        introduced setting of __gnat_in_child_after_fork.
diff --git a/gcc/ada/adaint.c b/gcc/ada/adaint.c
--- a/gcc/ada/adaint.c
+++ b/gcc/ada/adaint.c
@@ -2423,7 +2423,6 @@ __gnat_portable_spawn (char *args[] ATTRIBUTE_UNUSED)
   if (pid == 0)
     {
       /* The child. */
-      __gnat_in_child_after_fork = 1;
       if (execv (args[0], MAYBE_TO_PTR32 (args)) != 0)
 	_exit (1);
     }


Reply via email to