[PATCH v2 10/13] examples/l2fwd-macsec: remove print in signal handler
Stephen Hemminger
stephen at networkplumber.org
Mon Sep 7 19:03:28 CEST 2026
Calling printf in signal handler is not async-signal-safe.
The printf was unnecessary anyway so remove it.
Found by GCC -fanalyzer.
Signed-off-by: Stephen Hemminger <stephen at networkplumber.org>
Acked-by: Bruce Richardson <bruce.richardson at intel.com>
---
examples/l2fwd-macsec/main.c | 5 +----
1 file changed, 1 insertion(+), 4 deletions(-)
diff --git a/examples/l2fwd-macsec/main.c b/examples/l2fwd-macsec/main.c
index 059f8a2170..33113cb0f5 100644
--- a/examples/l2fwd-macsec/main.c
+++ b/examples/l2fwd-macsec/main.c
@@ -1247,11 +1247,8 @@ check_all_ports_link_status(uint32_t port_mask)
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;
- }
}
int
--
2.53.0
More information about the dev
mailing list