From 618cca243b3a437b3e33816f6e6de7942dfbbd1b Mon Sep 17 00:00:00 2001 From: fair Date: Tue, 7 Apr 1998 10:16:04 +0000 Subject: [PATCH] Change a few things to reference /usr/include/paths.h instead of local references. Fixing the default PATH is a bit more effort. --- bin/sh/histedit.c | 6 +++--- bin/sh/jobs.c | 15 +++++++++------ bin/sh/var.c | 5 +++-- 3 files changed, 15 insertions(+), 11 deletions(-) diff --git a/bin/sh/histedit.c b/bin/sh/histedit.c index 0c67cb69aa01..111850184660 100644 --- a/bin/sh/histedit.c +++ b/bin/sh/histedit.c @@ -1,4 +1,4 @@ -/* $NetBSD: histedit.c,v 1.17 1997/11/12 03:40:55 cjs Exp $ */ +/* $NetBSD: histedit.c,v 1.18 1998/04/07 10:16:04 fair Exp $ */ /*- * Copyright (c) 1993 @@ -41,7 +41,7 @@ #if 0 static char sccsid[] = "@(#)histedit.c 8.2 (Berkeley) 5/4/95"; #else -__RCSID("$NetBSD: histedit.c,v 1.17 1997/11/12 03:40:55 cjs Exp $"); +__RCSID("$NetBSD: histedit.c,v 1.18 1998/04/07 10:16:04 fair Exp $"); #endif #endif /* not lint */ @@ -338,7 +338,7 @@ histcmd(argc, argv) if (editor) { int fd; INTOFF; /* easier */ - sprintf(editfile, "%s/_shXXXXXX", _PATH_TMP); + sprintf(editfile, "%s_shXXXXXX", _PATH_TMP); if ((fd = mkstemp(editfile)) < 0) error("can't create temporary file %s", editfile); if ((efp = fdopen(fd, "w")) == NULL) { diff --git a/bin/sh/jobs.c b/bin/sh/jobs.c index b8261a6af552..7d725299a6eb 100644 --- a/bin/sh/jobs.c +++ b/bin/sh/jobs.c @@ -1,4 +1,4 @@ -/* $NetBSD: jobs.c,v 1.25 1998/02/04 23:49:25 thorpej Exp $ */ +/* $NetBSD: jobs.c,v 1.26 1998/04/07 10:16:04 fair Exp $ */ /*- * Copyright (c) 1991, 1993 @@ -41,7 +41,7 @@ #if 0 static char sccsid[] = "@(#)jobs.c 8.5 (Berkeley) 5/4/95"; #else -__RCSID("$NetBSD: jobs.c,v 1.25 1998/02/04 23:49:25 thorpej Exp $"); +__RCSID("$NetBSD: jobs.c,v 1.26 1998/04/07 10:16:04 fair Exp $"); #endif #endif /* not lint */ @@ -50,6 +50,7 @@ __RCSID("$NetBSD: jobs.c,v 1.25 1998/02/04 23:49:25 thorpej Exp $"); #include #include #include +#include #include #include #ifdef BSD @@ -572,6 +573,8 @@ forkshell(jp, n, mode) { int pid; int pgrp; + const char *devnull = _PATH_DEVNULL; + /* const */ char *nullerr = "Can't open %s"; TRACE(("forkshell(%%%d, 0x%lx, %d) called\n", jp - jobtab, (long)n, mode)); @@ -622,8 +625,8 @@ forkshell(jp, n, mode) if ((jp == NULL || jp->nprocs == 0) && ! fd0_redirected_p ()) { close(0); - if (open("/dev/null", O_RDONLY) != 0) - error("Can't open /dev/null"); + if (open(devnull, O_RDONLY) != 0) + error(nullerr, devnull); } } #else @@ -633,8 +636,8 @@ forkshell(jp, n, mode) if ((jp == NULL || jp->nprocs == 0) && ! fd0_redirected_p ()) { close(0); - if (open("/dev/null", O_RDONLY) != 0) - error("Can't open /dev/null"); + if (open(devnull, O_RDONLY) != 0) + error(nullerr, devnull); } } #endif diff --git a/bin/sh/var.c b/bin/sh/var.c index 7b8a1e76f6b8..d5987eb9e204 100644 --- a/bin/sh/var.c +++ b/bin/sh/var.c @@ -1,4 +1,4 @@ -/* $NetBSD: var.c,v 1.19 1997/07/04 21:02:25 christos Exp $ */ +/* $NetBSD: var.c,v 1.20 1998/04/07 10:16:04 fair Exp $ */ /*- * Copyright (c) 1991, 1993 @@ -41,7 +41,7 @@ #if 0 static char sccsid[] = "@(#)var.c 8.3 (Berkeley) 5/4/95"; #else -__RCSID("$NetBSD: var.c,v 1.19 1997/07/04 21:02:25 christos Exp $"); +__RCSID("$NetBSD: var.c,v 1.20 1998/04/07 10:16:04 fair Exp $"); #endif #endif /* not lint */ @@ -113,6 +113,7 @@ const struct varinit varinit[] = { NULL }, { &vmpath, VSTRFIXED|VTEXTFIXED|VUNSET, "MAILPATH=", NULL }, +/* this should be taken from as _PATH_DEFPATH XXX */ { &vpath, VSTRFIXED|VTEXTFIXED, "PATH=/bin:/usr/bin", changepath }, /*