git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jeff King <peff@peff.net>
To: Edward Thomson <ethomson@edwardthomson.com>
Cc: git@vger.kernel.org, gitster@pobox.com
Subject: Re: [PATCH] upload-pack: keep poll(2)'s timeout to -1
Date: Fri, 22 Aug 2014 11:44:45 -0400	[thread overview]
Message-ID: <20140822154445.GA19135@peff.net> (raw)
In-Reply-To: <20140822151911.GA8531@debian>

On Fri, Aug 22, 2014 at 03:19:11PM +0000, Edward Thomson wrote:

> 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.

That makes sense, and POSIX only specifies the behavior for -1 anyway.
The patch itself looks obviously correct. Thanks.

Since we're now translating the keepalive value, and since there's no
way to set it to "0" (nor would that really have any meaning), I guess
we could switch the internal "no keepalive" value to 0, and do:

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

which would let us avoid setting it to -1 in some other spots.  I dunno
if that actually makes a real difference to maintainability, though.
Either way:

  Acked-by: Jeff King <peff@peff.net>

-Peff

  reply	other threads:[~2014-08-22 15:44 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-08-22 15:19 [PATCH] upload-pack: keep poll(2)'s timeout to -1 Edward Thomson
2014-08-22 15:44 ` Jeff King [this message]
2014-08-22 15:56   ` Junio C Hamano
2014-08-22 16:03     ` Jeff King
2014-08-22 16:27       ` Edward Thomson
2014-08-22 18:26         ` Junio C Hamano
2014-08-22 18:19   ` Junio C Hamano
2014-08-22 18:21     ` Junio C Hamano

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20140822154445.GA19135@peff.net \
    --to=peff@peff.net \
    --cc=ethomson@edwardthomson.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).