mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 02:07:35 +00:00
sleep: Make variable written in signal handler volatile
No difference in practice, but it's tidier and protects us if we ever use g_interrupted earlier in main -- in that case, the compiler might chose to keep the variable in a register without the volatile. Found by @bugaevc, thanks!
This commit is contained in:
parent
a7f786fc0a
commit
a2a54f459f
1 changed files with 1 additions and 1 deletions
|
@ -30,7 +30,7 @@
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
|
|
||||||
static bool g_interrupted;
|
static volatile bool g_interrupted;
|
||||||
static void handle_sigint(int)
|
static void handle_sigint(int)
|
||||||
{
|
{
|
||||||
g_interrupted = true;
|
g_interrupted = true;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue