Skip to content

Commit

Permalink
Merge branch 'et/spell-poll-infinite-with-minus-one-only'
Browse files Browse the repository at this point in the history
We used to pass -1000 to poll(2), expecting it to also mean "no
timeout", which should be spelled as -1.

* et/spell-poll-infinite-with-minus-one-only:
  upload-pack: keep poll(2)'s timeout to -1
  • Loading branch information
Junio C Hamano committed Sep 11, 2014
2 parents 6c1d42a + 6c71f8b commit 9ddd689
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion upload-pack.c
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,9 @@ static void create_pack_file(void)
if (!pollsize)
break;

ret = poll(pfd, pollsize, 1000 * keepalive);
ret = poll(pfd, pollsize,
keepalive < 0 ? -1 : 1000 * keepalive);

if (ret < 0) {
if (errno != EINTR) {
error("poll failed, resuming: %s",
Expand Down

0 comments on commit 9ddd689

Please sign in to comment.