Page MenuHomeFreeBSD

Fix mountd's SIGHUP handler to set a variable of the correct type
ClosedPublic

Authored by rmacklem on Aug 1 2023, 1:10 AM.
Tags
None
Referenced Files
Unknown Object (File)
Oct 2 2024, 6:35 AM
Unknown Object (File)
Sep 18 2024, 5:44 AM
Unknown Object (File)
Sep 8 2024, 1:10 PM
Unknown Object (File)
Sep 7 2024, 6:16 PM
Unknown Object (File)
Sep 7 2024, 4:44 PM
Unknown Object (File)
Sep 7 2024, 5:18 AM
Unknown Object (File)
Aug 30 2024, 1:23 PM
Unknown Object (File)
Aug 30 2024, 1:23 PM
Subscribers

Details

Summary

Without this patch got_sighup(), which is the SIGHUP handler,
would set a variable of type int.

This would appear to be incorrect, although it has worked reliably.
This patch changes the type to "volatile sig_atomic_t", which appears
to be all that is needed to correct it.

Thanks got to Peter Eriksson for reporting this.

Test Plan

Mountd builds and handles SIGHUP correctly,
with the same behaviour as before the change.

Diff Detail

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

Event Timeline

This revision is now accepted and ready to land.Aug 1 2023, 3:36 AM

Use _Atomic(int) instead of volatile sig_atomic_t
as recommended by David C. (theraven@).

This revision now requires review to proceed.Aug 2 2023, 7:33 PM

Updated the diff as recommended by theraven@.

This revision is now accepted and ready to land.Aug 10 2023, 9:18 AM
This revision was automatically updated to reflect the committed changes.