opnsense-src/usr.bin/locate
Dag-Erling Smørgrav f62c1f3f8e locate.updatedb: Explicitly exit from trap code.
When a signal is trapped, the script continues after the trap code has
run, unless the trap code explicitly exits.  In the particular case of
locate.updatedb, this is mostly harmless, except that the trap code is
executed twice (once for the signal and once when we reach the end of
the script), but it's still worth fixing.

Furthermore, install the trap as soon as we've created the temporary
directory, to minimize the window during which we can fail to clean up
after ourselves if interrupted.

While here, simplify the empty check at the end and make some minor
style tweaks.

MFC after:	1 week
Sponsored by:	Klara, Inc.
Reviewed by:	kevans
Differential Revision:	https://reviews.freebsd.org/D46475
2024-08-29 17:05:47 +02:00
..
bigram Remove residual blank line at start of Makefile 2024-07-15 16:43:39 -06:00
code Remove residual blank line at start of Makefile 2024-07-15 16:43:39 -06:00
locate locate.updatedb: Explicitly exit from trap code. 2024-08-29 17:05:47 +02:00
Makefile Remove residual blank line at start of Makefile 2024-07-15 16:43:39 -06:00
Makefile.inc Remove residual blank line at start of Makefile 2024-07-15 16:43:39 -06:00