Re: [PATCH] CYGWIN: Use a TCP socket for pipe()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Torsten Bögershausen <tboegi@xxxxxx> writes:

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

> 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"
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]