[Openvpn-devel] sig.c: define signal_handler on non-windows only

Message ID 20220113101434.30223-1-a@unstable.cc
State Accepted
Headers show
Series [Openvpn-devel] sig.c: define signal_handler on non-windows only | expand

Commit Message

Antonio Quartulli Jan. 12, 2022, 11:14 p.m. UTC
signal_handler() is unused on Windows and generates a warning.
Confine it within "ifdef _WIN32" in order to reduce the compilation

Signed-off-by: Antonio Quartulli <a@unstable.cc>
 src/openvpn/sig.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)


Gert Doering Jan. 13, 2022, 8:02 p.m. UTC | #1
Acked-by: Gert Doering <gert@greenie.muc.de>

"makes sense".  Have not tested this.

(The result is still not pretty... maybe a better approach would be
to have all the "not win32" signal stuff in a single #ifdef, and
add empty do-nothing pre_init_signal_catch() etc. functions for WIN32
- but that's another patch for another day)

Your patch has been applied to the master branch.

commit 508ee74a9671d0175afeeb1711ba0f18d538cfb2
Author: Antonio Quartulli
Date:   Thu Jan 13 11:14:34 2022 +0100

     sig.c: define signal_handler on non-windows only

     Signed-off-by: Antonio Quartulli <a@unstable.cc>
     Acked-by: Gert Doering <gert@greenie.muc.de>
     Message-Id: <20220113101434.30223-1-a@unstable.cc>
     URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg23530.html
     Signed-off-by: Gert Doering <gert@greenie.muc.de>

kind regards,

Gert Doering


diff --git a/src/openvpn/sig.c b/src/openvpn/sig.c
index eadd7109..9747c083 100644
--- a/src/openvpn/sig.c
+++ b/src/openvpn/sig.c
@@ -214,7 +214,7 @@  signal_restart_status(const struct signal_info *si)
 #endif /* ifdef ENABLE_MANAGEMENT */
+#ifndef _WIN32
 /* normal signal handler, when we are in event loop */
 static void
 signal_handler(const int signum)
@@ -222,6 +222,7 @@  signal_handler(const int signum)
     signal(signum, signal_handler);
 /* set handlers for unix signals */