aboutsummaryrefslogtreecommitdiffstats
path: root/wpa_supplicant
diff options
context:
space:
mode:
authorJouni Malinen <j@w1.fi>2009-12-19 17:22:16 (GMT)
committerJouni Malinen <j@w1.fi>2009-12-19 17:22:16 (GMT)
commit0456ea16d8edfa47c4ff1ddabf4f496a3c5c67bd (patch)
treee9d5e769ac18c55f6fc7104f56b72fba7fcb0f7a /wpa_supplicant
parent9969e5a46a4671a6c75dfc6c2952296e170bf50b (diff)
downloadhostap-0456ea16d8edfa47c4ff1ddabf4f496a3c5c67bd.zip
hostap-0456ea16d8edfa47c4ff1ddabf4f496a3c5c67bd.tar.gz
hostap-0456ea16d8edfa47c4ff1ddabf4f496a3c5c67bd.tar.bz2
eloop: Remove global user data pointer
This is not really needed since all signal handlers can use a context pointer provided during signal handler registration.
Diffstat (limited to 'wpa_supplicant')
-rw-r--r--wpa_supplicant/ctrl_iface_dbus.c2
-rw-r--r--wpa_supplicant/ctrl_iface_dbus_new_helpers.c2
-rw-r--r--wpa_supplicant/eapol_test.c11
-rw-r--r--wpa_supplicant/preauth_test.c11
-rw-r--r--wpa_supplicant/tests/test_wpa.c2
-rw-r--r--wpa_supplicant/wpa_priv.c2
-rw-r--r--wpa_supplicant/wpa_supplicant.c16
7 files changed, 21 insertions, 25 deletions
diff --git a/wpa_supplicant/ctrl_iface_dbus.c b/wpa_supplicant/ctrl_iface_dbus.c
index 06f5a88..709e947 100644
--- a/wpa_supplicant/ctrl_iface_dbus.c
+++ b/wpa_supplicant/ctrl_iface_dbus.c
@@ -208,7 +208,7 @@ static void timeout_toggled(DBusTimeout *timeout, void *data)
}
-static void process_wakeup_main(int sig, void *eloop_ctx, void *signal_ctx)
+static void process_wakeup_main(int sig, void *signal_ctx)
{
struct ctrl_iface_dbus_priv *iface = signal_ctx;
diff --git a/wpa_supplicant/ctrl_iface_dbus_new_helpers.c b/wpa_supplicant/ctrl_iface_dbus_new_helpers.c
index 0273872..d2da615 100644
--- a/wpa_supplicant/ctrl_iface_dbus_new_helpers.c
+++ b/wpa_supplicant/ctrl_iface_dbus_new_helpers.c
@@ -270,7 +270,7 @@ static void timeout_toggled(DBusTimeout *timeout, void *data)
}
-static void process_wakeup_main(int sig, void *eloop_ctx, void *signal_ctx)
+static void process_wakeup_main(int sig, void *signal_ctx)
{
struct ctrl_iface_dbus_new_priv *iface = signal_ctx;
diff --git a/wpa_supplicant/eapol_test.c b/wpa_supplicant/eapol_test.c
index c73ec85..4eed854 100644
--- a/wpa_supplicant/eapol_test.c
+++ b/wpa_supplicant/eapol_test.c
@@ -949,10 +949,9 @@ static int scard_get_triplets(int argc, char *argv[])
}
-static void eapol_test_terminate(int sig, void *eloop_ctx,
- void *signal_ctx)
+static void eapol_test_terminate(int sig, void *signal_ctx)
{
- struct wpa_supplicant *wpa_s = eloop_ctx;
+ struct wpa_supplicant *wpa_s = signal_ctx;
wpa_msg(wpa_s, MSG_INFO, "Signal %d received - terminating", sig);
eloop_terminate();
}
@@ -1128,7 +1127,7 @@ int main(int argc, char *argv[])
return -1;
}
- if (eloop_init(&wpa_s)) {
+ if (eloop_init()) {
wpa_printf(MSG_ERROR, "Failed to initialize event loop");
return -1;
}
@@ -1171,8 +1170,8 @@ int main(int argc, char *argv[])
eloop_register_timeout(timeout, 0, eapol_test_timeout, &eapol_test,
NULL);
eloop_register_timeout(0, 0, send_eap_request_identity, &wpa_s, NULL);
- eloop_register_signal_terminate(eapol_test_terminate, NULL);
- eloop_register_signal_reconfig(eapol_test_terminate, NULL);
+ eloop_register_signal_terminate(eapol_test_terminate, &wpa_s);
+ eloop_register_signal_reconfig(eapol_test_terminate, &wpa_s);
eloop_run();
eloop_cancel_timeout(eapol_test_timeout, &eapol_test, NULL);
diff --git a/wpa_supplicant/preauth_test.c b/wpa_supplicant/preauth_test.c
index a24d65f..cebe2ba 100644
--- a/wpa_supplicant/preauth_test.c
+++ b/wpa_supplicant/preauth_test.c
@@ -277,10 +277,9 @@ static void wpa_init_conf(struct wpa_supplicant *wpa_s, const char *ifname)
}
-static void eapol_test_terminate(int sig, void *eloop_ctx,
- void *signal_ctx)
+static void eapol_test_terminate(int sig, void *signal_ctx)
{
- struct wpa_supplicant *wpa_s = eloop_ctx;
+ struct wpa_supplicant *wpa_s = signal_ctx;
wpa_msg(wpa_s, MSG_INFO, "Signal %d received - terminating", sig);
eloop_terminate();
}
@@ -317,7 +316,7 @@ int main(int argc, char *argv[])
return -1;
}
- if (eloop_init(&wpa_s)) {
+ if (eloop_init()) {
wpa_printf(MSG_ERROR, "Failed to initialize event loop");
return -1;
}
@@ -354,8 +353,8 @@ int main(int argc, char *argv[])
eloop_register_timeout(30, 0, eapol_test_timeout, &preauth_test, NULL);
eloop_register_timeout(0, 100000, eapol_test_poll, &wpa_s, NULL);
- eloop_register_signal_terminate(eapol_test_terminate, NULL);
- eloop_register_signal_reconfig(eapol_test_terminate, NULL);
+ eloop_register_signal_terminate(eapol_test_terminate, &wpa_s);
+ eloop_register_signal_reconfig(eapol_test_terminate, &wpa_s);
eloop_run();
if (preauth_test.auth_timed_out)
diff --git a/wpa_supplicant/tests/test_wpa.c b/wpa_supplicant/tests/test_wpa.c
index 77fc36a..7249ffb 100644
--- a/wpa_supplicant/tests/test_wpa.c
+++ b/wpa_supplicant/tests/test_wpa.c
@@ -351,7 +351,7 @@ int main(int argc, char *argv[])
wpa_debug_level = 0;
wpa_debug_show_keys = 1;
- if (eloop_init(&wpa)) {
+ if (eloop_init()) {
wpa_printf(MSG_ERROR, "Failed to initialize event loop");
return -1;
}
diff --git a/wpa_supplicant/wpa_priv.c b/wpa_supplicant/wpa_priv.c
index bb9095b..b7825ed 100644
--- a/wpa_supplicant/wpa_priv.c
+++ b/wpa_supplicant/wpa_priv.c
@@ -1029,7 +1029,7 @@ int main(int argc, char *argv[])
wpa_printf(MSG_DEBUG, "wpa_priv control directory: '%s'", ctrl_dir);
- if (eloop_init(NULL)) {
+ if (eloop_init()) {
wpa_printf(MSG_ERROR, "Failed to initialize event loop");
goto out;
}
diff --git a/wpa_supplicant/wpa_supplicant.c b/wpa_supplicant/wpa_supplicant.c
index d798661..df7d1d5 100644
--- a/wpa_supplicant/wpa_supplicant.c
+++ b/wpa_supplicant/wpa_supplicant.c
@@ -546,10 +546,9 @@ void wpa_supplicant_set_state(struct wpa_supplicant *wpa_s, wpa_states state)
}
-static void wpa_supplicant_terminate(int sig, void *eloop_ctx,
- void *signal_ctx)
+static void wpa_supplicant_terminate(int sig, void *signal_ctx)
{
- struct wpa_global *global = eloop_ctx;
+ struct wpa_global *global = signal_ctx;
struct wpa_supplicant *wpa_s;
for (wpa_s = global->ifaces; wpa_s; wpa_s = wpa_s->next) {
wpa_msg(wpa_s, MSG_INFO, WPA_EVENT_TERMINATING "- signal %d "
@@ -647,10 +646,9 @@ int wpa_supplicant_reload_configuration(struct wpa_supplicant *wpa_s)
}
-static void wpa_supplicant_reconfig(int sig, void *eloop_ctx,
- void *signal_ctx)
+static void wpa_supplicant_reconfig(int sig, void *signal_ctx)
{
- struct wpa_global *global = eloop_ctx;
+ struct wpa_global *global = signal_ctx;
struct wpa_supplicant *wpa_s;
wpa_printf(MSG_DEBUG, "Signal %d received - reconfiguring", sig);
for (wpa_s = global->ifaces; wpa_s; wpa_s = wpa_s->next) {
@@ -2320,7 +2318,7 @@ struct wpa_global * wpa_supplicant_init(struct wpa_params *params)
wpa_debug_timestamp = global->params.wpa_debug_timestamp =
params->wpa_debug_timestamp;
- if (eloop_init(global)) {
+ if (eloop_init()) {
wpa_printf(MSG_ERROR, "Failed to initialize event loop");
wpa_supplicant_deinit(global);
return NULL;
@@ -2389,8 +2387,8 @@ int wpa_supplicant_run(struct wpa_global *global)
wpa_s->ctrl_iface);
}
- eloop_register_signal_terminate(wpa_supplicant_terminate, NULL);
- eloop_register_signal_reconfig(wpa_supplicant_reconfig, NULL);
+ eloop_register_signal_terminate(wpa_supplicant_terminate, global);
+ eloop_register_signal_reconfig(wpa_supplicant_reconfig, global);
eloop_run();