about summary refs log tree commit diff
path: root/sysdeps/posix
diff options
context:
space:
mode:
Diffstat (limited to 'sysdeps/posix')
-rw-r--r--sysdeps/posix/system.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/sysdeps/posix/system.c b/sysdeps/posix/system.c
index bca1c2ec3e..08852801a6 100644
--- a/sysdeps/posix/system.c
+++ b/sysdeps/posix/system.c
@@ -112,7 +112,15 @@ do_system (const char *line)
 	}
     }
 
+#ifdef CLEANUP_HANDLER
+  CLEANUP_HANDLER;
+#endif
+
+#ifdef FORK
+  pid = FORK ();
+#else
   pid = __fork ();
+#endif
   if (pid == (pid_t) 0)
     {
       /* Child side.  */
@@ -158,6 +166,10 @@ do_system (const char *line)
 #endif
     }
 
+#ifdef CLEANUP_HANDLER
+  CLEANUP_RESET;
+#endif
+
   save = errno;
   DO_LOCK ();
   if ((SUB_REF () == 0