X-Git-Url: http://git.openwrt.org/?p=project%2Fiwinfo.git;a=blobdiff_plain;f=iwinfo_nl80211.c;h=e3a7e4d79d26500bdef7bbce03bd900785b1cba6;hp=63b70d5bed89df107dd3fc379bc23d8902a703fc;hb=7bba117a3a80e29d73b03b8a43a183ceca1f80c1;hpb=d22c64c2eb6db3db6aaac5ae270acd63ed088a20 diff --git a/iwinfo_nl80211.c b/iwinfo_nl80211.c index 63b70d5..e3a7e4d 100644 --- a/iwinfo_nl80211.c +++ b/iwinfo_nl80211.c @@ -481,6 +481,7 @@ static int nl80211_wait(const char *family, const char *group, int cmd) { struct nl80211_event_conveyor cv = { .wait = cmd }; struct nl_cb *cb; + int err = 0; if (nl80211_subscribe(family, group)) return -ENOENT; @@ -490,15 +491,16 @@ static int nl80211_wait(const char *family, const char *group, int cmd) if (!cb) return -ENOMEM; + nl_cb_err(cb, NL_CB_CUSTOM, nl80211_msg_error, &err); nl_cb_set(cb, NL_CB_SEQ_CHECK, NL_CB_CUSTOM, nl80211_wait_seq_check, NULL); nl_cb_set(cb, NL_CB_VALID, NL_CB_CUSTOM, nl80211_wait_cb, &cv ); - while (!cv.recv) + while (!cv.recv && !err) nl_recvmsgs(nls->nl_sock, cb); nl_cb_put(cb); - return 0; + return err; }