Re: [PATCH] CYGWIN: Use a TCP socket for pipe()
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Jun 27, 2013, 17:38 UTC
- Message-ID
- <7vvc4zsbbs.fsf@alter.siamese.dyndns.org>
- In-Reply-To
- <201306271831.13865.tboegi@web.de>
Torsten Bögershausen <tboegi@web.de> writes:
Show 5 quoted lines
> Work around issues that git hangs when doing fetch or pull under > various protocols under CYGWIN. > > Replace pipe() with a socket connection using a TCP/IP. > Introduce a new function socket_pipe() in compat/socket_pipe.c
Sounds like sweeping the real problem, whatever it is, under rug. Is it that we are assuming a pipe buffer that is sufficiently large and expecting a write that we deem to be small enough not to block, causing a deadlock on a platform with very small pipe buffer, or something?
> + (void)setsockopt(fd_listen, SOL_SOCKET, SO_REUSEADDR, > + (char*)&reuse_on, sizeof(reuse_on));
Broken indentation.
Either align (note: these are only to illustrate the column alignment; I am not encouraging to indent with leading SPs) the opening "(" of the "(char *)" cast with "f" in "fd_listen", like this,
(void)setsockopt(fd_listen, SOL_SOCKET, SO_REUSEADDR,
(char *)&reuse_on, sizeof(reuse_on));by a run of HT with minimum number of SP, or push the beginning of the second line past opening "(" after "setsockopt", like this,
(void)setsockopt(fd_listen, SOL_SOCKET, SO_REUSEADDR,
(char *)&reuse_on, sizeof(reuse_on));with a run of minimum number of HT without any SP.
Show 12 quoted lines
> diff --git a/git-compat-util.h b/git-compat-util.h > index c1f8a47..88632ab 100644 > --- a/git-compat-util.h > +++ b/git-compat-util.h > @@ -176,6 +176,10 @@ int get_st_mode_bits(const char *path, int *mode); > #endif > #endif > > +int socket_pipe(int filedes[2]); > +#ifdef GIT_USE_SOCKET_PIPE > +#define pipe(a) socket_pipe(a) > +#endif
Shouldn't the function declaration be inside this #ifdef?
> /* used on Mac OS X */ > #ifdef PRECOMPOSE_UNICODE > #include "compat/precompose_utf8.h"