Trap:
- EXIT (0)
- HUP (1)
- INT (2)
- QUIT (3)
- TRAP (5)
- USR1 (10)
- TERM (15)
every time mktemp is called to reduce the chances of leaving stray files
or directories with possible sensitive data inside.
We avoid using a template with mktemp, as some operating systems may use
unpredictable base paths by default (macOS).
Suggested by: des
---- NOTES ----
I'm not familiar with all the recommended traps[1]. Also I prefer to
list them by name. If the number is preferred, I'll change them without
hesitation. I changed the visibility of the local file/dir variables so
the function called by trap can catch it, again if any other approach is
preferred, just let me know.
I have updated/rebased the branch thatalso include D46789 and D46804:
https://github.com/jlduran/freebsd-src/commits/fix-git-arc-consolidated/
[1]: https://pubs.opengroup.org/onlinepubs/9799919799/utilities/V3_chap02.html#tag_19_29