diff options
author | David Herrmann <dh.herrmann@gmail.com> | 2014-02-05 18:45:22 +0100 |
---|---|---|
committer | David Herrmann <dh.herrmann@gmail.com> | 2014-02-05 18:45:22 +0100 |
commit | 6cbb247f876063145c4426bdeb98e7052c2205b0 (patch) | |
tree | 2607d3ec4dc79433e836851630d90c68c2ea878c | |
parent | 7d06c9b9b4cac672df9cd7c594d4a5580c6c6d31 (diff) |
wpa: use usual 10s timeout for DETACH
We really *have* to call DETACH in a synchronous fashion, otherwise
wpa_supplicant is too stupid to notice it immediately. Yey! It doesn't
hurt to let the FD linger, but that just causes weird wpa_supplicant
warnings that we want to avoid.
Hence, do a synchronous DETACH.
Signed-off-by: David Herrmann <dh.herrmann@gmail.com>
-rw-r--r-- | src/wpa_ctrl.c | 9 |
1 files changed, 2 insertions, 7 deletions
diff --git a/src/wpa_ctrl.c b/src/wpa_ctrl.c index 611f539..cb4a62b 100644 --- a/src/wpa_ctrl.c +++ b/src/wpa_ctrl.c @@ -325,7 +325,6 @@ _shl_public_ int wfd_wpa_ctrl_open(struct wfd_wpa_ctrl *wpa, const char *ctrl_path) { int r; - int64_t t; if (!wpa || !ctrl_path) return -EINVAL; @@ -356,8 +355,7 @@ int wfd_wpa_ctrl_open(struct wfd_wpa_ctrl *wpa, const char *ctrl_path) return 0; err_ev: - t = 0; - wpa_request(wpa->ev_fd, "DETACH", 6, NULL, NULL, &t, &wpa->mask); + wpa_request_ok(wpa->ev_fd, "DETACH", 6, NULL, &wpa->mask); close_socket(wpa, wpa->ev_fd, wpa->ev_name); wpa->ev_fd = -1; err_req: @@ -371,13 +369,10 @@ err_timer: _shl_public_ void wfd_wpa_ctrl_close(struct wfd_wpa_ctrl *wpa) { - int64_t t; - if (!wpa || !wfd_wpa_ctrl_is_open(wpa)) return; - t = 0; - wpa_request(wpa->ev_fd, "DETACH", 6, NULL, NULL, &t, &wpa->mask); + wpa_request_ok(wpa->ev_fd, "DETACH", 6, NULL, &wpa->mask); close_socket(wpa, wpa->ev_fd, wpa->ev_name); wpa->ev_fd = -1; |