As it turns out, the C standard forbids passing va_list by value and then
continue using it in the parent function (C Standard, 7.16, paragraph 3).
Luckily, there's a footnote stating:
"It is permitted to create a pointer to a va_list and pass that
pointer to another function, in which case the original function may
take further use of the original list after the other function
returns."
Therefore, we're safe passing va_list by reference and thus can keep the
current coding style.
This fixes weird bugs on ARM32 which really doesn't allow passing va_list
by value.
Signed-off-by: David Herrmann <dh.herrmann@gmail.com>
We _must_ aggressively drain input queues before we signal any HUP. There
might be queued messages that tell us important information about the
termination of wpa_supplicant.
Therefore, if a write() operation fails, we only signal HUP if the input
queues are empty. However, we cannot rely on EPOLLIN to be set, as the
input data might have arrived in between epoll_wait() and write(),
therefore, always run the non-blocking read() in case write() failed.
Signed-off-by: David Herrmann <dh.herrmann@gmail.com>
The wpas-helpers provide easy _asynchronous_ access to wpa_supplicant
control interfaces. Compared to the old wpa_ctrl_* stuff it's no longer
synchronous. Thus, it doesn't block our daemon while wpa_supplicant runs
some heavy work again..
Signed-off-by: David Herrmann <dh.herrmann@gmail.com>