summary refs log tree commit diff
path: root/sysdeps/posix/system.c
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>2002-12-17 06:52:45 +0000
committerUlrich Drepper <drepper@redhat.com>2002-12-17 06:52:45 +0000
commit3ca97e8f0f08c85aecc08f5f171e46729e04911d (patch)
tree6a5d1517f52d649f0a46ba6dbf6bf1bf55b072d2 /sysdeps/posix/system.c
parent26a026b94036e2e2a41a6693327d796cc82bdacd (diff)
downloadglibc-3ca97e8f0f08c85aecc08f5f171e46729e04911d.tar.gz
glibc-3ca97e8f0f08c85aecc08f5f171e46729e04911d.tar.xz
glibc-3ca97e8f0f08c85aecc08f5f171e46729e04911d.zip
Update.
	* sysdeps/posix/system.c (do_system): Add support for installation
	of cancellation handlers.
	* sysdeps/unix/sysv/linux/i386/system.c: New file.

	* stdlib/Makefile (tests): Add tst-system.
	* stdlib/tst-system.c: New file.
Diffstat (limited to 'sysdeps/posix/system.c')
-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