aboutsummaryrefslogtreecommitdiff
path: root/compat/poll
diff options
context:
space:
mode:
authorRandall S. Becker <randall.becker@nexbridge.ca>2017-09-29 07:47:17 +0900
committerJunio C Hamano <gitster@pobox.com>2017-09-29 18:33:22 +0900
commit61b2a1acaae22b0b4cd45218525d9890e03b377c (patch)
treedb0f049bc8699c388e9f94d5f0775195d6aa7c11 /compat/poll
parent9752ad0bb79f680bca48db7adc45338b298304b0 (diff)
downloadgit-61b2a1acaae22b0b4cd45218525d9890e03b377c.tar.gz
git-61b2a1acaae22b0b4cd45218525d9890e03b377c.tar.xz
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>
Diffstat (limited to 'compat/poll')
-rw-r--r--compat/poll/poll.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/compat/poll/poll.c b/compat/poll/poll.c
index b10adc780..ae03b74a6 100644
--- a/compat/poll/poll.c
+++ b/compat/poll/poll.c
@@ -438,6 +438,10 @@ poll (struct pollfd *pfd, nfds_t nfd, int timeout)
pfd[i].revents = happened;
rc++;
}
+ else
+ {
+ pfd[i].revents = 0;
+ }
}
return rc;