aboutsummaryrefslogtreecommitdiff
path: root/bin
diff options
context:
space:
mode:
authorTom Ryder <tom@sanctum.geek.nz>2016-08-04 23:37:09 +1200
committerTom Ryder <tom@sanctum.geek.nz>2016-08-04 23:37:09 +1200
commit1b0a9d30ea5e95929589b19acb36786317c5637a (patch)
treebd90f9b853b368d70cc2bfa0c8b8793d334f3783 /bin
parentTrying new 'breakindent' Vim feature (diff)
downloaddotfiles-1b0a9d30ea5e95929589b19acb36786317c5637a.tar.gz
dotfiles-1b0a9d30ea5e95929589b19acb36786317c5637a.zip
Add missing code to tmpfile cleanup hooks
Diffstat (limited to 'bin')
-rwxr-xr-xbin/rndl8
-rwxr-xr-xbin/tlcs8
2 files changed, 12 insertions, 4 deletions
diff --git a/bin/rndl b/bin/rndl
index 3e92044c..14721539 100755
--- a/bin/rndl
+++ b/bin/rndl
@@ -3,10 +3,14 @@
if [ "$#" -eq 0 ] ; then
td=
cleanup() {
- rm -fr -- "$td"
+ [ "$td" ] && rm -fr -- "$td"
+ if [ "$1" != EXIT ] ; then
+ trap - "$1"
+ kill "-$1" "$$"
+ fi
}
for sig in EXIT HUP INT TERM ; do
- trap cleanup "$sig"
+ trap "cleanup $sig" "$sig"
done
td=$(mktd rndl) || exit
set -- "$td"/stdin
diff --git a/bin/tlcs b/bin/tlcs
index 8ba6cefc..996fb5ce 100755
--- a/bin/tlcs
+++ b/bin/tlcs
@@ -70,10 +70,14 @@ fi
# Temporary directory for the FIFOs
td=
cleanup() {
- rm -fr -- "$td"
+ [ "$td" ] && rm -fr -- "$td"
+ if [ "$1" != EXIT ] ; then
+ trap - "$1"
+ kill "-$1" "$$"
+ fi
}
for sig in EXIT HUP INT TERM ; do
- trap cleanup "$sig"
+ trap "cleanup $sig" "$sig"
done
td=$(mktd "$self") || exit