Thread (1 message) 1 message, 1 author, 2016-06-15

Re: [PATCH] upload-pack: keep poll(2)'s timeout to -1

From: Junio C Hamano <hidden>
Date: 2016-06-15 23:02:19

Jeff King [off-list ref] writes:
On Fri, Aug 22, 2014 at 03:19:11PM +0000, Edward Thomson wrote:
quoted
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 [off-list ref]

-Peff
There is 1000 * wakeup in credential-cache--daemon.c, by the way.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help