about summary refs log tree commit diff
path: root/sysdeps/posix/system.c
diff options
context:
space:
mode:
Diffstat (limited to 'sysdeps/posix/system.c')
-rw-r--r--sysdeps/posix/system.c22
1 files changed, 14 insertions, 8 deletions
diff --git a/sysdeps/posix/system.c b/sysdeps/posix/system.c
index e72b97792b..d7e0bcf254 100644
--- a/sysdeps/posix/system.c
+++ b/sysdeps/posix/system.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991-1999, 2000 Free Software Foundation, Inc.
+/* Copyright (C) 1991-99,2000,02 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
    The GNU C Library is free software; you can redistribute it and/or
@@ -33,8 +33,8 @@
 #define	SHELL_NAME	"sh"		/* Name to give it.  */
 
 /* Execute LINE as a shell command, returning its status.  */
-int
-__libc_system (const char *line)
+static int
+do_system (const char *line)
 {
   int status, save;
   pid_t pid;
@@ -43,11 +43,6 @@ __libc_system (const char *line)
   sigset_t block, omask;
 #endif
 
-  if (line == NULL)
-    /* Check that we have a command processor available.  It might
-       not be available after a chroot(), for example.  */
-    return __libc_system ("exit 0") == 0;
-
   sa.sa_handler = SIG_IGN;
   sa.sa_flags = 0;
   __sigemptyset (&sa.sa_mask);
@@ -154,4 +149,15 @@ __libc_system (const char *line)
 
   return status;
 }
+
+int
+__libc_system (const char *line)
+{
+  if (line == NULL)
+    /* Check that we have a command processor available.  It might
+       not be available after a chroot(), for example.  */
+    return do_system ("exit 0") == 0;
+
+  return do_system (line);
+}
 weak_alias (__libc_system, system)