diff options
| author | Daniel Eischen <deischen@FreeBSD.org> | 2001-01-24 13:01:12 +0000 |
|---|---|---|
| committer | Daniel Eischen <deischen@FreeBSD.org> | 2001-01-24 13:01:12 +0000 |
| commit | d201fe46e355212750b727061e6a7ac005267852 (patch) | |
| tree | d949d903e602687ee53252807dc4281a27c4f0c4 /lib/libc/stdlib/system.c | |
| parent | e0aa5ab7184d7449e4c2e2e65107898ad23b31f7 (diff) | |
Notes
Diffstat (limited to 'lib/libc/stdlib/system.c')
| -rw-r--r-- | lib/libc/stdlib/system.c | 24 |
1 files changed, 13 insertions, 11 deletions
diff --git a/lib/libc/stdlib/system.c b/lib/libc/stdlib/system.c index c7e68bae69b7..3b1645414069 100644 --- a/lib/libc/stdlib/system.c +++ b/lib/libc/stdlib/system.c @@ -37,6 +37,7 @@ static char sccsid[] = "@(#)system.c 8.1 (Berkeley) 6/4/93"; #endif /* LIBC_SCCS and not lint */ +#include "namespace.h" #include <sys/types.h> #include <sys/wait.h> #include <signal.h> @@ -45,6 +46,8 @@ static char sccsid[] = "@(#)system.c 8.1 (Berkeley) 6/4/93"; #include <unistd.h> #include <paths.h> #include <errno.h> +#include "un-namespace.h" +#include "libc_private.h" int __system(command) @@ -65,11 +68,11 @@ __system(command) ign.sa_handler = SIG_IGN; (void)sigemptyset(&ign.sa_mask); ign.sa_flags = 0; - (void)sigaction(SIGINT, &ign, &intact); - (void)sigaction(SIGQUIT, &ign, &quitact); + (void)_sigaction(SIGINT, &ign, &intact); + (void)_sigaction(SIGQUIT, &ign, &quitact); (void)sigemptyset(&newsigblock); (void)sigaddset(&newsigblock, SIGCHLD); - (void)sigprocmask(SIG_BLOCK, &newsigblock, &oldsigblock); + (void)_sigprocmask(SIG_BLOCK, &newsigblock, &oldsigblock); switch(pid = fork()) { case -1: /* error */ break; @@ -77,9 +80,9 @@ __system(command) /* * Restore original signal dispositions and exec the command. */ - (void)sigaction(SIGINT, &intact, NULL); - (void)sigaction(SIGQUIT, &quitact, NULL); - (void)sigprocmask(SIG_SETMASK, &oldsigblock, NULL); + (void)_sigaction(SIGINT, &intact, NULL); + (void)_sigaction(SIGQUIT, &quitact, NULL); + (void)_sigprocmask(SIG_SETMASK, &oldsigblock, NULL); execl(_PATH_BSHELL, "sh", "-c", command, (char *)NULL); _exit(127); default: /* parent */ @@ -88,12 +91,11 @@ __system(command) } while (pid == -1 && errno == EINTR); break; } - (void)sigaction(SIGINT, &intact, NULL); - (void)sigaction(SIGQUIT, &quitact, NULL); - (void)sigprocmask(SIG_SETMASK, &oldsigblock, NULL); + (void)_sigaction(SIGINT, &intact, NULL); + (void)_sigaction(SIGQUIT, &quitact, NULL); + (void)_sigprocmask(SIG_SETMASK, &oldsigblock, NULL); return(pid == -1 ? -1 : pstat); } -#ifndef _THREAD_SAFE __weak_reference(__system, system); -#endif +__weak_reference(__system, _system); |
