summaryrefslogtreecommitdiff
path: root/src/lib/libc/stdlib/system.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/libc/stdlib/system.c')
-rw-r--r--src/lib/libc/stdlib/system.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/lib/libc/stdlib/system.c b/src/lib/libc/stdlib/system.c
index 91f98888af..3e1b047393 100644
--- a/src/lib/libc/stdlib/system.c
+++ b/src/lib/libc/stdlib/system.c
@@ -32,7 +32,7 @@
32 */ 32 */
33 33
34#if defined(LIBC_SCCS) && !defined(lint) 34#if defined(LIBC_SCCS) && !defined(lint)
35static char *rcsid = "$OpenBSD: system.c,v 1.2 1996/08/19 08:33:54 tholo Exp $"; 35static char *rcsid = "$OpenBSD: system.c,v 1.3 1996/09/15 09:31:52 tholo Exp $";
36#endif /* LIBC_SCCS and not lint */ 36#endif /* LIBC_SCCS and not lint */
37 37
38#include <sys/types.h> 38#include <sys/types.h>
@@ -52,11 +52,13 @@ system(command)
52 sig_t intsave, quitsave; 52 sig_t intsave, quitsave;
53 int omask; 53 int omask;
54 int pstat; 54 int pstat;
55 char *argp[] = {"sh", "-c", (char *) command, NULL}; 55 char *argp[] = {"sh", "-c", NULL, NULL};
56 56
57 if (!command) /* just checking... */ 57 if (!command) /* just checking... */
58 return(1); 58 return(1);
59 59
60 argp[2] = (char *)command;
61
60 omask = sigblock(sigmask(SIGCHLD)); 62 omask = sigblock(sigmask(SIGCHLD));
61 switch(pid = vfork()) { 63 switch(pid = vfork()) {
62 case -1: /* error */ 64 case -1: /* error */