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)
Fri, May 3, 8:15 AM
Unknown Object (File)
Fri, May 3, 8:15 AM
Unknown Object (File)
Fri, May 3, 8:15 AM
Unknown Object (File)
Fri, May 3, 8:15 AM
Unknown Object (File)
Sat, Apr 27, 8:59 PM
Unknown Object (File)
Sun, Apr 21, 6:05 AM
Unknown Object (File)
Sun, Apr 14, 8:59 PM
Unknown Object (File)
Tue, Apr 9, 8:06 AM
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.