poll.c: always set revents, even if to zero

Match what is done to pfd[i].revents when compute_revents() returns 0 to the upstream gnulib's commit d42461c3 ("poll: fixes for large fds", 2015-02-20). The revents field is set to 0, without incrementing the value rc to be returned from the function. The original code left the field to whatever random value the field was initialized to. This fixes occasional hangs in git-upload-pack on HPE NonStop. Signed-off-by: Randall S. Becker <randall.becker@nexbridge.ca> Reviewed-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Randall S. Becker committed Sep 29, 2017 at 07:47 UTC 61b2a1acaae22b0b4cd45218525d9890e03b377c
1 file changed +4
compat/poll/poll.c
+4
@@ -438,6 +438,10 @@ poll (struct pollfd *pfd, nfds_t nfd, int timeout)
438 pfd[i].revents = happened;
439 rc++;
440 }
441 + else
442 + {
443 + pfd[i].revents = 0;
444 + }
445 }
446
447 return rc;