summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlex Xu (Hello71) <alex_y_xu@yahoo.ca>2021-06-24 12:33:35 -0400
committerAlex Xu (Hello71) <alex_y_xu@yahoo.ca>2021-06-24 12:33:35 -0400
commit0c58c357d2b3288c4a4502d5ac2ecd34cc441f4f (patch)
tree09af582e56320fd52c15c8cd7729a9d79b04cd47
parented9913745c36e9244cea831bbb7efb3e1d4544bc (diff)
downloadtmpoverlay-0c58c357d2b3288c4a4502d5ac2ecd34cc441f4f.tar.xz
tmpoverlay-0c58c357d2b3288c4a4502d5ac2ecd34cc441f4f.zip
handle SIGINT
-rwxr-xr-xtmpoverlay3
1 files changed, 2 insertions, 1 deletions
diff --git a/tmpoverlay b/tmpoverlay
index b2fe6d9..e817e87 100755
--- a/tmpoverlay
+++ b/tmpoverlay
@@ -134,9 +134,10 @@ esac
mount -t tmpfs ${tmpfs_opts:+-o "$tmpfs_opts"} $verbose tmpfs "$tmpdir" || { rmdir "$tmpdir"; die; }
mkfifo "$tmpdir/fifo" || { umount "$tmpdir"; rmdir "$tmpdir"; die; }
# subshell allows cleanup after overmount /tmp without using realpath source
-# subshell also avoids trapping signals which is annoying in shell
+# subshell also avoids trapping and re-raising signals which is annoying in shell
(
cd "$tmpdir" || die
+ trap '' INT || die
exec <fifo || die
# read returns non-zero when write end is closed
read _