From 6e824f3713011f7955a4f88fb16445e8e2cbe72c Mon Sep 17 00:00:00 2001 From: Kyle Evans Date: Wed, 22 May 2024 00:36:29 -0500 Subject: [PATCH] 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;