Remove environment variable settings.

Now that we are not abusing $HOME to get to the terminfo db, make it visible.
This commit is contained in:
christos 2011-06-17 16:59:51 +00:00
parent 046bfa491c
commit 355eb06ba8
3 changed files with 12 additions and 19 deletions

View File

@ -1,4 +1,4 @@
# $NetBSD: Makefile,v 1.1 2011/04/10 09:55:08 blymn Exp $ # $NetBSD: Makefile,v 1.2 2011/06/17 16:59:51 christos Exp $
NOMAN= # defined NOMAN= # defined
@ -9,7 +9,7 @@ SUBDIR= director slave tests check_files
TESTSDIR= ${TESTSBASE}/lib/libcurses TESTSDIR= ${TESTSBASE}/lib/libcurses
TEST_TERMINFO= atf.terminfo TEST_TERMINFO= atf.terminfo
TERMINFO_DB= .terminfo TERMINFO_DB= terminfo
TERMINFODIR= ${TESTSDIR} TERMINFODIR= ${TESTSDIR}
FILESDIR= ${TESTSDIR} FILESDIR= ${TESTSDIR}

View File

@ -1,4 +1,4 @@
/* $NetBSD: director.c,v 1.6 2011/06/17 02:15:28 christos Exp $ */ /* $NetBSD: director.c,v 1.7 2011/06/17 16:59:51 christos Exp $ */
/*- /*-
* Copyright 2009 Brett Lymn <blymn@NetBSD.org> * Copyright 2009 Brett Lymn <blymn@NetBSD.org>
@ -199,16 +199,14 @@ main(int argc, char *argv[])
if (S_ISDIR(st.st_mode)) { if (S_ISDIR(st.st_mode)) {
char tinfo[MAXPATHLEN]; char tinfo[MAXPATHLEN];
snprintf(tinfo, sizeof(tinfo), "%s/%s", termpath, int l = snprintf(tinfo, sizeof(tinfo), "%s/%s", termpath,
".terminfo.db"); "terminfo.db");
if (stat(tinfo, &st) == -1) { if (stat(tinfo, &st) == -1)
snprintf(tinfo, sizeof(tinfo), "%s/%s", termpath, err(1, "Cannot stat `%s'", tinfo);
"terminfo.db"); if (l >= 3)
if (stat(tinfo, &st) == -1) tinfo[l - 3] = '\0';
err(1, "Cannot stat `%s/%s' or `%s/%s'", if (setenv("TERMINFO", tinfo, 1) != 0)
termpath, "terminfo.db", termpath, err(1, "Failed to set TERMINFO variable");
".terminfo.db");
}
} else { } else {
int fd; int fd;
char *tinfo; char *tinfo;
@ -218,7 +216,7 @@ main(int argc, char *argv[])
fd, 0)) == MAP_FAILED) fd, 0)) == MAP_FAILED)
err(1, "Cannot map `%s'", termpath); err(1, "Cannot map `%s'", termpath);
if (setenv("TERMINFO", tinfo, 1) != 0) if (setenv("TERMINFO", tinfo, 1) != 0)
err(2, "Failed to set TERMINFO variable"); err(1, "Failed to set TERMINFO variable");
close(fd); close(fd);
munmap(tinfo, (size_t)st.st_size); munmap(tinfo, (size_t)st.st_size);
} }

View File

@ -3,11 +3,6 @@ h_run()
{ {
file="$(atf_get_srcdir)/tests/${1}" file="$(atf_get_srcdir)/tests/${1}"
HOME=$(atf_get_srcdir)
CHECK_PATH=
INCLUDE_PATH=$(atf_get_srcdir)/tests
export CHECK_PATH INCLUDE_PATH HOME
$(atf_get_srcdir)/director \ $(atf_get_srcdir)/director \
-T $(atf_get_srcdir) \ -T $(atf_get_srcdir) \
-t atf \ -t atf \