Page MenuHomeFreeBSD

locate.updatedb: Explicitly exit from trap code.
ClosedPublic

Authored by des on Aug 29 2024, 1:23 PM.
Tags
None
Referenced Files
F101949211: D46475.id142587.diff
Tue, Nov 5, 5:57 PM
Unknown Object (File)
Sat, Oct 19, 8:29 PM
Unknown Object (File)
Oct 6 2024, 11:07 AM
Unknown Object (File)
Sep 30 2024, 11:21 PM
Unknown Object (File)
Sep 30 2024, 7:19 AM
Unknown Object (File)
Sep 22 2024, 2:16 PM
Unknown Object (File)
Sep 19 2024, 2:25 PM
Unknown Object (File)
Sep 18 2024, 7:03 PM
Subscribers

Details

Summary

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).

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.

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

des requested review of this revision.Aug 29 2024, 1:23 PM
des edited the summary of this revision. (Show Details)
This revision is now accepted and ready to land.Aug 29 2024, 2:37 PM
This revision was automatically updated to reflect the committed changes.