From: Jeff King <peff@peff.net>
To: Ramsay Jones <ramsay@ramsay1.demon.co.uk>
Cc: GIT Mailing-list <git@vger.kernel.org>
Subject: Re: [PATCH 0/2] git-credential-cache--daemon on Cygwin
Date: Sat, 22 Oct 2011 15:15:10 -0400 [thread overview]
Message-ID: <20111022191509.GB1785@sigill.intra.peff.net> (raw)
In-Reply-To: <4EA2FC0D.5060404@ramsay1.demon.co.uk>
On Sat, Oct 22, 2011 at 06:23:25PM +0100, Ramsay Jones wrote:
> 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.
> 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
next prev parent reply other threads:[~2011-10-22 19:16 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-10-22 17:23 [PATCH 0/2] git-credential-cache--daemon on Cygwin Ramsay Jones
2011-10-22 19:15 ` Jeff King [this message]
2011-10-27 17:18 ` Ramsay Jones
2011-10-27 17:41 ` Jeff King
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20111022191509.GB1785@sigill.intra.peff.net \
--to=peff@peff.net \
--cc=git@vger.kernel.org \
--cc=ramsay@ramsay1.demon.co.uk \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).