summaryrefslogtreecommitdiff
path: root/usr.sbin
diff options
context:
space:
mode:
authorReyk Floeter <reyk@cvs.openbsd.org>2005-04-13 21:15:37 +0000
committerReyk Floeter <reyk@cvs.openbsd.org>2005-04-13 21:15:37 +0000
commitd0ce38bc9b74fae350509cf7e5be7fe308e49204 (patch)
tree4a8f1334515e99f58fb0af054769166ac200d1d0 /usr.sbin
parent4b6fcb58281e0581b34105566467ba4525578917 (diff)
un-hack, use event_loopexit()
ok henning@ brad@
Diffstat (limited to 'usr.sbin')
-rw-r--r--usr.sbin/hostapd/hostapd.c13
-rw-r--r--usr.sbin/hostapd/privsep.c13
2 files changed, 14 insertions, 12 deletions
diff --git a/usr.sbin/hostapd/hostapd.c b/usr.sbin/hostapd/hostapd.c
index f931024862f..9280816e5c5 100644
--- a/usr.sbin/hostapd/hostapd.c
+++ b/usr.sbin/hostapd/hostapd.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: hostapd.c,v 1.7 2005/04/13 19:59:08 jmc Exp $ */
+/* $OpenBSD: hostapd.c,v 1.8 2005/04/13 21:15:36 reyk Exp $ */
/*
* Copyright (c) 2004, 2005 Reyk Floeter <reyk@vantronix.net>
@@ -55,9 +55,6 @@ struct hostapd_config hostapd_cfg;
extern char *__progname;
-/* defined in event(3) to terminate the event loop */
-extern volatile sig_atomic_t event_gotterm;
-
void
hostapd_usage(void)
{
@@ -262,13 +259,17 @@ hostapd_udp_init(struct hostapd_config *cfg)
void
hostapd_sig_handler(int sig)
{
+ struct timeval tv;
+
+ tv.tv_sec = 0;
+ tv.tv_usec = 0;
+
switch (sig) {
case SIGALRM:
case SIGTERM:
case SIGQUIT:
case SIGINT:
- /* This will terminate libevent's main loop */
- event_gotterm = 1;
+ event_loopexit(&tv);
}
}
diff --git a/usr.sbin/hostapd/privsep.c b/usr.sbin/hostapd/privsep.c
index 849be5a868a..f4221208709 100644
--- a/usr.sbin/hostapd/privsep.c
+++ b/usr.sbin/hostapd/privsep.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: privsep.c,v 1.8 2005/04/13 21:02:44 moritz Exp $ */
+/* $OpenBSD: privsep.c,v 1.9 2005/04/13 21:15:36 reyk Exp $ */
/*
* Copyright (c) 2004, 2005 Reyk Floeter <reyk@vantronix.net>
@@ -69,9 +69,6 @@ void hostapd_must_write(int, void *, size_t);
static int priv_fd = -1;
static volatile pid_t child_pid = -1;
-/* defined in event(3) to terminate the event loop */
-extern volatile sig_atomic_t event_gotterm;
-
/*
* Main privsep functions
*/
@@ -377,13 +374,17 @@ hostapd_sig_relay(int sig)
void
hostapd_sig_chld(int sig)
{
+ struct timeval tv;
+
+ tv.tv_sec = 0;
+ tv.tv_usec = 0;
+
/*
* If parent gets a SIGCHLD, it will exit.
*/
if (sig == SIGCHLD) {
- /* This will terminate libevent's main loop */
- event_gotterm = 1;
+ event_loopexit(&tv);
}
}