about summary refs log tree commit diff
path: root/sysdeps
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>2003-01-04 22:37:17 +0000
committerUlrich Drepper <drepper@redhat.com>2003-01-04 22:37:17 +0000
commit71302f5f86f2cc6d7b57eb51e5830db2d2497fe4 (patch)
tree350704370758412831425b9c322106b6e38559a9 /sysdeps
parentfd4b70ea8066990604783bb2810f197f95f8ffd1 (diff)
downloadglibc-71302f5f86f2cc6d7b57eb51e5830db2d2497fe4.tar.gz
glibc-71302f5f86f2cc6d7b57eb51e5830db2d2497fe4.tar.xz
glibc-71302f5f86f2cc6d7b57eb51e5830db2d2497fe4.zip
(do_system): Minor optimizations. Remove unnecessary code.
Diffstat (limited to 'sysdeps')
-rw-r--r--sysdeps/posix/system.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/sysdeps/posix/system.c b/sysdeps/posix/system.c
index fddb4f08ac..b1c826e4bc 100644
--- a/sysdeps/posix/system.c
+++ b/sysdeps/posix/system.c
@@ -64,9 +64,7 @@ do_system (const char *line)
 #ifndef _LIBC_REENTRANT
   struct sigaction intr, quit;
 #endif
-#ifndef WAITPID_CANNOT_BLOCK_SIGCHLD
-  sigset_t block, omask;
-#endif
+  sigset_t omask;
 
   sa.sa_handler = SIG_IGN;
   sa.sa_flags = 0;
@@ -78,8 +76,7 @@ do_system (const char *line)
       if (__sigaction (SIGINT, &sa, &intr) < 0)
 	{
 	  SUB_REF ();
-	  DO_UNLOCK ();
-	  return -1;
+	  goto out;
 	}
       if (__sigaction (SIGQUIT, &sa, &quit) < 0)
 	{
@@ -90,25 +87,28 @@ do_system (const char *line)
     }
   DO_UNLOCK ();
 
-  __sigemptyset (&block);
-  __sigaddset (&block, SIGCHLD);
+  /* We reuse the bitmap in the 'sa' structure.  */
+  __sigaddset (&sa.sa_mask, SIGCHLD);
   save = errno;
-  if (__sigprocmask (SIG_BLOCK, &block, &omask) < 0)
+  if (__sigprocmask (SIG_BLOCK, &sa.sa_mask, &omask) < 0)
     {
+#ifndef _LIBC
       if (errno == ENOSYS)
 	__set_errno (save);
       else
+#endif
 	{
-	  save = errno;
 	  DO_LOCK ();
 	  if (SUB_REF () == 0)
 	    {
+	      save = errno;
 	      (void) __sigaction (SIGQUIT, &quit, (struct sigaction *) NULL);
 	    out_restore_sigint:
 	      (void) __sigaction (SIGINT, &intr, (struct sigaction *) NULL);
+	      __set_errno (save);
 	    }
+	out:
 	  DO_UNLOCK ();
-	  __set_errno (save);
 	  return -1;
 	}
     }