Explicitely check for errors on fds

Previous code checked for no activity (!POLLIN) and would error out with
2 fds and only one active.
merge-requests/1/head
Julien BLACHE 2009-08-09 09:31:12 +02:00
rodzic 504547028b
commit 161ca93aa5
2 zmienionych plików z 5 dodań i 1 usunięć

Wyświetl plik

@ -1,3 +1,7 @@
2009-08-08 Julien Blache <jb@jblache.org>
- frontend/saned.c: run_standalone(), explicitely check for errors
on fds.
2009-08-07 m. allan noah <kitno455 at gmail dot com>
* backend/fujitsu.[ch], backend/fujitsu-scsi.h: Backend v96
- split sane_get_parameters into two functions

Wyświetl plik

@ -3106,7 +3106,7 @@ run_standalone (int argc, char **argv)
for (i = 0, fdp = fds; i < nfds; i++, fdp++)
{
/* Error on an fd */
if (! (fdp->revents & POLLIN))
if (fdp->revents & (POLLERR | POLLHUP | POLLNVAL))
{
for (i = 0, fdp = fds; i < nfds; i++, fdp++)
close (fdp->fd);