git/list[1] front-page[2] threads[3] people[4] search[5] about
 

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"
Previous: Torsten BögershausenNext: Mark Levedahl
Message 2 of 6 in “CYGWIN: Use a TCP socket for pipe()”
  1. CYGWIN: Use a TCP socket for pipe()Torsten Bögershausen, Jun 27, 2013
  2. Junio C HamanoJun 27, 2013
  3. Mark LevedahlJun 28, 2013
  4. Torsten BögershausenJun 30, 2013
  5. Junio C HamanoJun 30, 2013
  6. Torsten BögershausenJul 2, 2013

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.