The __attribute__ ((unused)) is useful sometimes to declare variables as
intended to be unused, e.g. in callback functions. However, they tend
to clutter up the code making hard to read. We therefore remove all
uses of it and instead set -Wno-unused-parameter.
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
There's an issue with uftpd not exiting properly. Cannot nail it down
properly but it seems to be related to the stopping of active timers.
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
If an I/O watcher callback fails to read(), returning zero, we check
events for UEV_HUP to detect EOF or socket remote end shutdown().
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
This patch adds UEV_ERROR handling to the test I/O watcher, restarting
the watcher properly. Also, additional error handling to read(), which
was unchecked and failed when fuzzing the libc read() function.
We also take the opportunity to document the reasons for when using the
w->fd (watcher descriptor) and when *not* to in the test. Even to the
author this was confusing and looked suspicious.
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
Many users look at both examples *and* unit tests to learn how to use a
library. We should pride ourselves in that we have not just working but
also correct and readable tests.
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>