[PATCH 01/13] graph: do not call printf in signal
Stephen Hemminger
stephen at networkplumber.org
Mon Sep 7 01:24:36 CEST 2026
Printf is not signal safe and calling it in a signal handler
get flagged as an error by GCC analyzer.
Signed-off-by: Stephen Hemminger <stephen at networkplumber.org>
---
app/graph/main.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/app/graph/main.c b/app/graph/main.c
index 56294f2693..d36d60bf94 100644
--- a/app/graph/main.c
+++ b/app/graph/main.c
@@ -49,10 +49,8 @@ static struct app_params {
static void
signal_handler(int signum)
{
- if (signum == SIGINT || signum == SIGTERM) {
- printf("\n\nSignal %d received, preparing to exit...\n", signum);
+ if (signum == SIGINT || signum == SIGTERM)
force_quit = true;
- }
}
static int
--
2.53.0
More information about the dev
mailing list