[libbsd 2/9] wpa: Do not use signals

Sebastian Huber sebastian.huber at embedded-brains.de
Fri Jun 10 06:08:28 UTC 2022


---
 freebsd/contrib/wpa/src/utils/eloop.c | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)

diff --git a/freebsd/contrib/wpa/src/utils/eloop.c b/freebsd/contrib/wpa/src/utils/eloop.c
index 41de0f79..b26de5a0 100644
--- a/freebsd/contrib/wpa/src/utils/eloop.c
+++ b/freebsd/contrib/wpa/src/utils/eloop.c
@@ -955,6 +955,7 @@ int eloop_replenish_timeout(unsigned int req_secs, unsigned int req_usecs,
 }
 
 
+#ifndef __rtems__
 #ifndef CONFIG_NATIVE_WINDOWS
 static void eloop_handle_alarm(int sig)
 {
@@ -966,8 +967,10 @@ static void eloop_handle_alarm(int sig)
 	exit(1);
 }
 #endif /* CONFIG_NATIVE_WINDOWS */
+#endif /* __rtems__ */
 
 
+#ifndef __rtems__
 static void eloop_handle_signal(int sig)
 {
 	int i;
@@ -990,6 +993,7 @@ static void eloop_handle_signal(int sig)
 		}
 	}
 }
+#endif /* __rtems__ */
 
 
 static void eloop_process_pending_signals(void)
@@ -1001,9 +1005,11 @@ static void eloop_process_pending_signals(void)
 	eloop.signaled = 0;
 
 	if (eloop.pending_terminate) {
+#ifndef __rtems__
 #ifndef CONFIG_NATIVE_WINDOWS
 		alarm(0);
 #endif /* CONFIG_NATIVE_WINDOWS */
+#endif /* __rtems__ */
 		eloop.pending_terminate = 0;
 	}
 
@@ -1017,6 +1023,7 @@ static void eloop_process_pending_signals(void)
 }
 
 
+#ifndef __rtems__
 int eloop_register_signal(int sig, eloop_signal_handler handler,
 			  void *user_data)
 {
@@ -1037,26 +1044,35 @@ int eloop_register_signal(int sig, eloop_signal_handler handler,
 
 	return 0;
 }
+#endif /* __rtems__ */
 
 
 int eloop_register_signal_terminate(eloop_signal_handler handler,
 				    void *user_data)
 {
+#ifndef __rtems__
 	int ret = eloop_register_signal(SIGINT, handler, user_data);
 	if (ret == 0)
 		ret = eloop_register_signal(SIGTERM, handler, user_data);
 	return ret;
+#else /* __rtems__ */
+	return 0;
+#endif /* __rtems__ */
 }
 
 
 int eloop_register_signal_reconfig(eloop_signal_handler handler,
 				   void *user_data)
 {
+#ifndef __rtems__
 #ifdef CONFIG_NATIVE_WINDOWS
 	return 0;
 #else /* CONFIG_NATIVE_WINDOWS */
 	return eloop_register_signal(SIGHUP, handler, user_data);
 #endif /* CONFIG_NATIVE_WINDOWS */
+#else /* __rtems__ */
+	return 0;
+#endif /* __rtems__ */
 }
 
 
-- 
2.35.3



More information about the devel mailing list