t9c, 9l: use $TMPDIR if available (#272) - plan9port - [fork] Plan 9 from user space
(HTM) git clone git://src.adamsgaard.dk/plan9port
(DIR) Log
(DIR) Files
(DIR) Refs
(DIR) README
(DIR) LICENSE
---
(DIR) commit 436ff26c3688198de8e8e48121296eace0b5d119
(DIR) parent b0aecb4ba5c3d7df6589c01f5a7c0427f5a75305
(HTM) Author: Jason Felice <jason.m.felice@gmail.com>
Date: Mon, 11 Nov 2019 17:06:55 -0500
9c, 9l: use $TMPDIR if available (#272)
NixOS sandboxed builds (at least on Mac) don't have access to /tmp,
and this should be better POSIX.
Diffstat:
M bin/9c | 2 +-
M bin/9l | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
---
(DIR) diff --git a/bin/9c b/bin/9c
t@@ -133,7 +133,7 @@ case "$tag" in
esac
# N.B. Must use temp file to avoid pipe; pipe loses status.
-xtmp=/tmp/9c.$$.$USER.out
+xtmp=${TMPDIR-/tmp}/9c.$$.$USER.out
$cc -DPLAN9PORT -I$PLAN9/include $cflags "$@" 2>$xtmp
status=$?
quiet $xtmp
(DIR) diff --git a/bin/9l b/bin/9l
t@@ -346,7 +346,7 @@ then
echo $ld -L$PLAN9/lib "$@" $libsl $extralibs $frameworks
fi
-xtmp=/tmp/9l.$$.$USER.out
+xtmp="${TMPDIR-/tmp}/9l.$$.$USER.out"
xxout() {
sed 's/.*: In function `[^:]*: *//' $xtmp | egrep . |
egrep -v 'is (often|almost always) misused|is dangerous, better use|text-based stub'