aboutsummaryrefslogtreecommitdiff
path: root/bin/tlcs
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/tlcs
parentTrying new 'breakindent' Vim feature (diff)
downloaddotfiles-1b0a9d30ea5e95929589b19acb36786317c5637a.tar.gz
dotfiles-1b0a9d30ea5e95929589b19acb36786317c5637a.zip
Add missing code to tmpfile cleanup hooks
Diffstat (limited to 'bin/tlcs')
-rwxr-xr-xbin/tlcs8
1 files changed, 6 insertions, 2 deletions
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