Re: init(8): signal handler boolean needs to be "volatile"

2022-09-09 Thread Todd C . Miller
On Fri, 09 Sep 2022 14:05:46 -0500, Scott Cheloha wrote:

> The variable "clang" is modified from a signal handler.  It should be
> of type sig_atomic_t and it needs to be volatile.

Right.  OK millert@

 - todd



init(8): signal handler boolean needs to be "volatile"

2022-09-09 Thread Scott Cheloha
The variable "clang" is modified from a signal handler.  It should be
of type sig_atomic_t and it needs to be volatile.

ok?

Index: init.c
===
RCS file: /cvs/src/sbin/init/init.c,v
retrieving revision 1.71
diff -u -p -r1.71 init.c
--- init.c  24 Oct 2021 21:24:21 -  1.71
+++ init.c  9 Sep 2022 19:03:08 -
@@ -176,7 +176,8 @@ void setsecuritylevel(int);
 void setprocresources(char *);
 int getsecuritylevel(void);
 int setupargv(session_t *, struct ttyent *);
-int clang;
+
+volatile sig_atomic_t clang;
 
 void clear_session_logs(session_t *);