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

Re: [PATCH 0/2] git-credential-cache--daemon on Cygwin

From
Jeff King <peff@peff.net>
Date
Oct 22, 2011, 19:15 UTC
Message-ID
<20111022191509.GB1785@sigill.intra.peff.net>
In-Reply-To
<4EA2FC0D.5060404@ramsay1.demon.co.uk>
On Sat, Oct 22, 2011 at 06:23:25PM +0100, Ramsay Jones wrote:
Show 23 quoted lines
> I had a quick look, and found that unix_stream_listen() was failing to
> bind() to a stale unix socket. The code looked OK to me, and should have
> handled this just fine, but didn't ...
> 
> On a hunch, I found that the following "belt-n-braces" approach fixed the
> the test for me:
> 
> -- >8 --
> diff --git a/unix-socket.c b/unix-socket.c
> index cf9890f..d974e01 100644
> --- a/unix-socket.c
> +++ b/unix-socket.c
> @@ -42,7 +42,9 @@ int unix_stream_listen(const char *path)
>  	fd = unix_stream_socket();
>  
>  	if (bind(fd, (struct sockaddr *)&sa, sizeof(sa)) < 0) {
> +		close(fd);
>  		unlink(path);
> +		fd = unix_stream_socket();
>  		if (bind(fd, (struct sockaddr *)&sa, sizeof(sa)) < 0) {
>  			close(fd);
>  			return -1;
> -- 8< --
Wow, that seems horribly broken on the part of cygwin.

I think your solution to just unlink first() is the right way to go. I have a few comments, though so I'll respond to each of the patches individually.

> Assuming that a modified http-auth-keyring series will make a return to pu
> sometime, could you please squash these patches into (the patch corresponding to)
> commit 2d6874d (credentials: add "cache" helper, 18-07-2011). Thanks!
I'm planning a reroll, so I'll squash them (or something similar) in.
Show 5 quoted lines
> Also, note that this series breaks the build on MinGW. The patch to fix the build
> is rather simple, but the result doesn't work, of course, because winsock does
> not know about AF_UNIX (or AF_LOCAL). I started to code an win32 emulation of unix
> sockets, but stopped working on it when this branch dropped from next. If you
> intend to re-submit this work, then I can pick this up again.

Right. I sort of expected that, and figured we could just drop the cache helper on mingw until somebody felt like writing such an emulation layer.

It's definitely coming back, so if you feel like working on it, please do. Also note that if it would be easier to have an alternate abstraction for inter-process communication on windows, I'm open to doing that in the cache daemon.

-Peff
Previous: Ramsay JonesNext: Ramsay Jones
Message 2 of 4 in “git-credential-cache--daemon on Cygwin”
  1. 0/2 git-credential-cache--daemon on CygwinRamsay Jones, Oct 22, 2011
  2. Jeff KingOct 22, 2011
  3. Ramsay JonesOct 27, 2011
  4. Jeff KingOct 27, 2011

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.