Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/lib/libc/stdlib system(3): Simplify initialization of argp.



details:   https://anonhg.NetBSD.org/src/rev/2ee157edd2b1
branches:  trunk
changeset: 363906:2ee157edd2b1
user:      riastradh <riastradh%NetBSD.org@localhost>
date:      Mon Mar 14 22:14:19 2022 +0000

description:
system(3): Simplify initialization of argp.

diffstat:

 lib/libc/stdlib/system.c |  8 +++-----
 1 files changed, 3 insertions(+), 5 deletions(-)

diffs (32 lines):

diff -r 404781ec07ee -r 2ee157edd2b1 lib/libc/stdlib/system.c
--- a/lib/libc/stdlib/system.c  Mon Mar 14 22:06:28 2022 +0000
+++ b/lib/libc/stdlib/system.c  Mon Mar 14 22:14:19 2022 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: system.c,v 1.27 2022/03/14 22:06:28 riastradh Exp $    */
+/*     $NetBSD: system.c,v 1.28 2022/03/14 22:14:19 riastradh Exp $    */
 
 /*
  * Copyright (c) 1988, 1993
@@ -34,7 +34,7 @@
 #if 0
 static char sccsid[] = "@(#)system.c   8.1 (Berkeley) 6/4/93";
 #else
-__RCSID("$NetBSD: system.c,v 1.27 2022/03/14 22:06:28 riastradh Exp $");
+__RCSID("$NetBSD: system.c,v 1.28 2022/03/14 22:14:19 riastradh Exp $");
 #endif
 #endif /* LIBC_SCCS and not lint */
 
@@ -57,12 +57,10 @@
        struct sigaction intsa, quitsa, sa;
        sigset_t nmask, omask, sigdefault;
        int pstat;
-       const char *argp[] = {"sh", "-c", "--", NULL, NULL};
+       const char *argp[] = {"sh", "-c", "--", command, NULL};
        posix_spawnattr_t attr;
        int error;
 
-       argp[3] = command;
-
        /*
         * ISO/IEC 9899:1999 in 7.20.4.6 describes this special case.
         * We need to check availability of a command interpreter.



Home | Main Index | Thread Index | Old Index