Skip to content

Commit

Permalink
upload-pack: keep poll(2)'s timeout to -1
Browse files Browse the repository at this point in the history
Keep poll's timeout at -1 when uploadpack.keepalive = 0, instead of
setting it to -1000, since some pedantic old systems (eg HP-UX) and
the gnulib compat/poll will treat only -1 as the valid value for
an infinite timeout.

Signed-off-by: Edward Thomson <ethomson@microsoft.com>
Acked-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
  • Loading branch information
Edward Thomson authored and Junio C Hamano committed Aug 22, 2014
1 parent d31f3ad commit 6c71f8b
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 @@ -158,7 +158,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 6c71f8b

Please sign in to comment.