From: Alberto Leiva Popper Date: Thu, 29 Aug 2024 22:33:40 +0000 (-0600) Subject: Separate POLLERR and POLLNVAL for rsync poll X-Git-Tag: 1.6.4~3^2~3 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=01a5b5b8667a845eb814bdd1addccd316b5c3148;p=thirdparty%2FFORT-validator.git Separate POLLERR and POLLNVAL for rsync poll POLLERR must induce close(), POLLNVAL must not. --- diff --git a/src/rsync/rsync.c b/src/rsync/rsync.c index 049417b1..8dd28150 100644 --- a/src/rsync/rsync.c +++ b/src/rsync/rsync.c @@ -191,8 +191,12 @@ exhaust_read_fd(int fd, int type) close(fd); return 1; } - if (pfd[0].revents & (POLLERR|POLLNVAL)) { + if (pfd[0].revents & POLLNVAL) { pr_val_err("rsync bad fd: %i", pfd[0].fd); + return 1; /* Already closed */ + } else if (pfd[0].revents & POLLERR) { + pr_val_err("Generic error during rsync poll."); + close(fd); return 1; } else if (pfd[0].revents & (POLLIN|POLLHUP)) { count = read(fd, buffer, sizeof(buffer));