Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 22 May 2024 05:37:56 GMT
From:      Kyle Evans <kevans@FreeBSD.org>
To:        src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org
Subject:   git: 6e824f371301 - main - time: siginfo_recvd needs to be marked volatile
Message-ID:  <202405220537.44M5bugu007292@gitrepo.freebsd.org>

next in thread | raw e-mail | index | archive | help
The branch main has been updated by kevans:

URL: https://cgit.FreeBSD.org/src/commit/?id=6e824f3713011f7955a4f88fb16445e8e2cbe72c

commit 6e824f3713011f7955a4f88fb16445e8e2cbe72c
Author:     Kyle Evans <kevans@FreeBSD.org>
AuthorDate: 2024-05-22 05:36:29 +0000
Commit:     Kyle Evans <kevans@FreeBSD.org>
CommitDate: 2024-05-22 05:37:41 +0000

    time: siginfo_recvd needs to be marked volatile
    
    sig_atomic_t does not imply volatility, we must do it ourselves to avoid
    caching of siginfo_recvd loads.
    
    Sponsored by:   Klara, Inc.
---
 usr.bin/time/time.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/usr.bin/time/time.c b/usr.bin/time/time.c
index 92148ab2e35b..4c1ce06543e3 100644
--- a/usr.bin/time/time.c
+++ b/usr.bin/time/time.c
@@ -54,7 +54,7 @@ static void showtime(FILE *, struct timespec *, struct timespec *,
 static void siginfo(int);
 static void usage(void) __dead2;
 
-static sig_atomic_t siginfo_recvd;
+static volatile sig_atomic_t siginfo_recvd;
 static char decimal_point;
 static struct timespec before_ts;
 static int hflag, pflag;



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