Source-Changes-HG archive

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

[src/trunk]: src/usr.bin/make Rather than hardcoding "/bin/sh", use _PATH_BSH...



details:   https://anonhg.NetBSD.org/src/rev/81379ed7b2e8
branches:  trunk
changeset: 526194:81379ed7b2e8
user:      bjh21 <bjh21%NetBSD.org@localhost>
date:      Sat Apr 27 15:14:30 2002 +0000

description:
Rather than hardcoding "/bin/sh", use _PATH_BSHELL.  To allow bootstrapping,
provide a default for this in pathnames.h, and only include <paths.h> ifndef
MAKE_BOOTSTRAP.

diffstat:

 usr.bin/make/compat.c    |  9 +++++----
 usr.bin/make/main.c      |  8 ++++----
 usr.bin/make/pathnames.h |  9 ++++++++-
 3 files changed, 17 insertions(+), 9 deletions(-)

diffs (107 lines):

diff -r 599b886ded22 -r 81379ed7b2e8 usr.bin/make/compat.c
--- a/usr.bin/make/compat.c     Sat Apr 27 12:36:47 2002 +0000
+++ b/usr.bin/make/compat.c     Sat Apr 27 15:14:30 2002 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: compat.c,v 1.42 2002/03/21 01:24:43 christos Exp $     */
+/*     $NetBSD: compat.c,v 1.43 2002/04/27 15:14:30 bjh21 Exp $        */
 
 /*
  * Copyright (c) 1988, 1989, 1990 The Regents of the University of California.
@@ -39,14 +39,14 @@
  */
 
 #ifdef MAKE_BOOTSTRAP
-static char rcsid[] = "$NetBSD: compat.c,v 1.42 2002/03/21 01:24:43 christos Exp $";
+static char rcsid[] = "$NetBSD: compat.c,v 1.43 2002/04/27 15:14:30 bjh21 Exp $";
 #else
 #include <sys/cdefs.h>
 #ifndef lint
 #if 0
 static char sccsid[] = "@(#)compat.c   8.2 (Berkeley) 3/19/94";
 #else
-__RCSID("$NetBSD: compat.c,v 1.42 2002/03/21 01:24:43 christos Exp $");
+__RCSID("$NetBSD: compat.c,v 1.43 2002/04/27 15:14:30 bjh21 Exp $");
 #endif
 #endif /* not lint */
 #endif
@@ -75,6 +75,7 @@
 #include    "hash.h"
 #include    "dir.h"
 #include    "job.h"
+#include    "pathnames.h"
 
 /*
  * The following array is used to make a fast determination of which
@@ -255,7 +256,7 @@
         * -e flag as well as -c if it's supposed to exit when it hits an
         * error.
         */
-       static char     *shargv[4] = { "/bin/sh" };
+       static char     *shargv[4] = { _PATH_BSHELL };
 
        if (DEBUG(SHELL))
                shargv[1] = (errCheck ? "-exc" : "-xc");
diff -r 599b886ded22 -r 81379ed7b2e8 usr.bin/make/main.c
--- a/usr.bin/make/main.c       Sat Apr 27 12:36:47 2002 +0000
+++ b/usr.bin/make/main.c       Sat Apr 27 15:14:30 2002 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: main.c,v 1.83 2002/03/14 16:08:39 pk Exp $     */
+/*     $NetBSD: main.c,v 1.84 2002/04/27 15:14:30 bjh21 Exp $  */
 
 /*
  * Copyright (c) 1988, 1989, 1990, 1993
@@ -39,7 +39,7 @@
  */
 
 #ifdef MAKE_BOOTSTRAP
-static char rcsid[] = "$NetBSD: main.c,v 1.83 2002/03/14 16:08:39 pk Exp $";
+static char rcsid[] = "$NetBSD: main.c,v 1.84 2002/04/27 15:14:30 bjh21 Exp $";
 #else
 #include <sys/cdefs.h>
 #ifndef lint
@@ -51,7 +51,7 @@
 #if 0
 static char sccsid[] = "@(#)main.c     8.3 (Berkeley) 3/19/94";
 #else
-__RCSID("$NetBSD: main.c,v 1.83 2002/03/14 16:08:39 pk Exp $");
+__RCSID("$NetBSD: main.c,v 1.84 2002/04/27 15:14:30 bjh21 Exp $");
 #endif
 #endif /* not lint */
 #endif
@@ -1263,7 +1263,7 @@
        (void) dup2(fds[1], 1);
        (void) close(fds[1]);
 
-       (void) execv("/bin/sh", args);
+       (void) execv(_PATH_BSHELL, args);
        _exit(1);
        /*NOTREACHED*/
 
diff -r 599b886ded22 -r 81379ed7b2e8 usr.bin/make/pathnames.h
--- a/usr.bin/make/pathnames.h  Sat Apr 27 12:36:47 2002 +0000
+++ b/usr.bin/make/pathnames.h  Sat Apr 27 15:14:30 2002 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: pathnames.h,v 1.8 2002/04/24 20:38:47 bjh21 Exp $      */
+/*     $NetBSD: pathnames.h,v 1.9 2002/04/27 15:14:30 bjh21 Exp $      */
 
 /*
  * Copyright (c) 1990, 1993
@@ -35,11 +35,18 @@
  *     from: @(#)pathnames.h   5.2 (Berkeley) 6/1/90
  */
 
+#ifndef MAKE_BOOTSTRAP
+#include <paths.h>
+#endif
+
 #define        _PATH_OBJDIR            "obj"
 #define        _PATH_OBJDIRPREFIX      "/usr/obj"
 #ifndef _PATH_DEFSHELLDIR
 #define        _PATH_DEFSHELLDIR       "/bin"
 #endif
+#ifndef _PATH_BSHELL
+#define _PATH_BSHELL           "/bin/sh"
+#endif
 #define        _PATH_DEFSYSMK          "sys.mk"
 #ifndef _PATH_DEFSYSPATH
 #define        _PATH_DEFSYSPATH        "/usr/share/mk"



Home | Main Index | Thread Index | Old Index