git: 2409231121ba - main - mountd: Fix type of signal variable
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Thu, 10 Aug 2023 19:51:42 UTC
The branch main has been updated by rmacklem:
URL: https://cgit.FreeBSD.org/src/commit/?id=2409231121ba6fc0ce5c16dc070b564c613c8fc5
commit 2409231121ba6fc0ce5c16dc070b564c613c8fc5
Author: Rick Macklem <rmacklem@FreeBSD.org>
AuthorDate: 2023-08-10 19:50:35 +0000
Commit: Rick Macklem <rmacklem@FreeBSD.org>
CommitDate: 2023-08-10 19:50:35 +0000
mountd: Fix type of signal variable
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 "_Atomic(int)", which appears
to be all that is needed to correct it.
Reported by: pen@lysator.lui.se
Reviewed by: theraven, karels (prev version), kevans (prev version)
Differential Revision: https://reviews.freebsd.org/D41265
---
usr.sbin/mountd/mountd.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/usr.sbin/mountd/mountd.c b/usr.sbin/mountd/mountd.c
index 1924284bb93a..22dfcc3c1abb 100644
--- a/usr.sbin/mountd/mountd.c
+++ b/usr.sbin/mountd/mountd.c
@@ -290,7 +290,7 @@ static int resvport_only = 1;
static int nhosts = 0;
static int dir_only = 1;
static int dolog = 0;
-static int got_sighup = 0;
+static _Atomic(int) got_sighup = 0;
static int xcreated = 0;
static char *svcport_str = NULL;