diff options
author | Alex Xu (Hello71) <alex_y_xu@yahoo.ca> | 2021-06-24 12:33:35 -0400 |
---|---|---|
committer | Alex Xu (Hello71) <alex_y_xu@yahoo.ca> | 2021-06-24 12:33:35 -0400 |
commit | 0c58c357d2b3288c4a4502d5ac2ecd34cc441f4f (patch) | |
tree | 09af582e56320fd52c15c8cd7729a9d79b04cd47 | |
parent | ed9913745c36e9244cea831bbb7efb3e1d4544bc (diff) | |
download | tmpoverlay-0c58c357d2b3288c4a4502d5ac2ecd34cc441f4f.tar.xz tmpoverlay-0c58c357d2b3288c4a4502d5ac2ecd34cc441f4f.zip |
handle SIGINT
-rwxr-xr-x | tmpoverlay | 3 |
1 files changed, 2 insertions, 1 deletions
@@ -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 _ |