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.
This commit is contained in:
bjh21 2002-04-27 15:14:30 +00:00
parent 0201440bd2
commit b846107274
3 changed files with 17 additions and 9 deletions

View File

@ -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 @@ __RCSID("$NetBSD: compat.c,v 1.42 2002/03/21 01:24:43 christos Exp $");
#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 @@ CompatRunCommand (cmdp, gnp)
* -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");

View File

@ -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 @@ __COPYRIGHT("@(#) Copyright (c) 1988, 1989, 1990, 1993\n\
#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 @@ Cmd_Exec(cmd, err)
(void) dup2(fds[1], 1);
(void) close(fds[1]);
(void) execv("/bin/sh", args);
(void) execv(_PATH_BSHELL, args);
_exit(1);
/*NOTREACHED*/

View File

@ -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"