Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 10 Aug 2023 19:51:42 GMT
From:      Rick Macklem <rmacklem@FreeBSD.org>
To:        src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org
Subject:   git: 2409231121ba - main - mountd: Fix type of signal variable
Message-ID:  <202308101951.37AJpgud070646@gitrepo.freebsd.org>

next in thread | raw e-mail | index | archive | help
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;



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202308101951.37AJpgud070646>