aboutsummaryrefslogtreecommitdiffstats
path: root/hostapd
diff options
context:
space:
mode:
authorRoy Marples <roy@marples.name>2016-01-22 20:28:25 (GMT)
committerJouni Malinen <j@w1.fi>2016-02-07 10:38:04 (GMT)
commit2e69bdd16ac1c4c6a974e588f41aa954f05f1487 (patch)
tree6bccbf561ceef9034bcd79a53c4fac052e44cb94 /hostapd
parent70f4f052f1b183cff150cc8ed2299e52921f6a36 (diff)
downloadhostap-2e69bdd16ac1c4c6a974e588f41aa954f05f1487.zip
hostap-2e69bdd16ac1c4c6a974e588f41aa954f05f1487.tar.gz
hostap-2e69bdd16ac1c4c6a974e588f41aa954f05f1487.tar.bz2
eloop: Add eloop_sock_requeue()
This function can be used to re-build eloop socket tables after forking for eloop implementations that need this. Signed-off-by: Roy Marples <roy@marples.name>
Diffstat (limited to 'hostapd')
-rw-r--r--hostapd/hostapd_cli.c2
-rw-r--r--hostapd/main.c13
2 files changed, 11 insertions, 4 deletions
diff --git a/hostapd/hostapd_cli.c b/hostapd/hostapd_cli.c
index 52dfc9f..7e6ac23 100644
--- a/hostapd/hostapd_cli.c
+++ b/hostapd/hostapd_cli.c
@@ -1444,7 +1444,7 @@ int main(int argc, char *argv[])
}
}
- if (daemonize && os_daemonize(pid_file))
+ if (daemonize && os_daemonize(pid_file) && eloop_sock_requeue())
return -1;
if (interactive)
diff --git a/hostapd/main.c b/hostapd/main.c
index 4913cbd..1b9002c 100644
--- a/hostapd/main.c
+++ b/hostapd/main.c
@@ -408,9 +408,16 @@ static int hostapd_global_run(struct hapd_interfaces *ifaces, int daemonize,
}
#endif /* EAP_SERVER_TNC */
- if (daemonize && os_daemonize(pid_file)) {
- wpa_printf(MSG_ERROR, "daemon: %s", strerror(errno));
- return -1;
+ if (daemonize) {
+ if (os_daemonize(pid_file)) {
+ wpa_printf(MSG_ERROR, "daemon: %s", strerror(errno));
+ return -1;
+ }
+ if (eloop_sock_requeue()) {
+ wpa_printf(MSG_ERROR, "eloop_sock_requeue: %s",
+ strerror(errno));
+ return -1;
+ }
}
eloop_run();