diff options
author | Edward Thomson <ethomson@edwardthomson.com> | 2014-08-22 15:19:11 +0000 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2014-08-22 11:19:47 -0700 |
commit | 6c71f8b0d3d39beffe050f92f33a25dc30dffca3 (patch) | |
tree | bb4eb9e63e13d585460a62d8bb0466613738fdb3 /upload-pack.c | |
parent | d31f3ad23dd1aee3c3e1015a43b02b995c01a9a1 (diff) | |
download | git-6c71f8b0d3d39beffe050f92f33a25dc30dffca3.tar.gz |
upload-pack: keep poll(2)'s timeout to -1et/spell-poll-infinite-with-minus-one-only
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>
Diffstat (limited to 'upload-pack.c')
-rw-r--r-- | upload-pack.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/upload-pack.c b/upload-pack.c index a3c52f691d..12c6b4d1a0 100644 --- a/upload-pack.c +++ b/upload-pack.c @@ -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", |