[PATCH v2 4/5] pb-discover: Fix signal handler
Geoff Levand
geoff at infradead.org
Mon May 4 04:27:09 AEST 2020
Variables shared between signal handlers and the main program
need to be of type 'volatile sig_atomic_t'.
Signed-off-by: Geoff Levand <geoff at infradead.org>
---
Here's a V2 that has the re-enable call removed.
discover/pb-discover.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/discover/pb-discover.c b/discover/pb-discover.c
index e2b36dd..6f43cc3 100644
--- a/discover/pb-discover.c
+++ b/discover/pb-discover.c
@@ -113,7 +113,7 @@ static int opts_parse(struct opts *opts, int argc, char *argv[])
return optind != argc;
}
-static int running;
+static volatile sig_atomic_t running;
static void sigint_handler(int __attribute__((unused)) signum)
{
--
2.20.1
More information about the Petitboot
mailing list