On Sun, Jun 15, 2014 at 10:52:09AM -0400, Jason Pyeron wrote:

> > Could this be a cygwin weirdness? I'd be interested to see the output
> > of:
> > 
> >   echo url=https://example.com |
> 
> >   strace -f git credential-cache get
> 
> On cygwin things can git a bit weird, I changed it to the actual executable.

Ugh, I forgot how difficult cygwin strace is to read. I think the
interesting bit is here:

> 1053395 1084132 [main] git-credential-cache 4308 __set_errno: void
> __set_winsock_errno(const char*, int):230 setting errno 0
>    88 1084220 [main] git-credential-cache 4308 __set_winsock_errno: 
> connect:1118
> - winsock error 0 -> errno 0
>    46 1084266 [main] git-credential-cache 4308 getpid: 4308 = getpid()
>    37 1084303 [main] git-credential-cache 4308 cygwin_connect: -1 = connect(3,
> 0x22A5A2, 110), errno 0

So yeah, it looks like errno does not get set properly in this case. I
think the only thing to do is just loosen the error path, like:

diff --git a/credential-cache.c b/credential-cache.c
index 9a03792..d0a1106 100644
--- a/credential-cache.c
+++ b/credential-cache.c
@@ -72,8 +72,6 @@ static void do_cache(const char *socket, const char *action, 
int timeout,
        }
 
        if (send_request(socket, &buf) < 0) {
-               if (errno != ENOENT && errno != ECONNREFUSED)
-                       die_errno("unable to connect to cache daemon");
                if (flags & FLAG_SPAWN) {
                        spawn_daemon(socket);
                        if (send_request(socket, &buf) < 0)

I'd rather not do that on all platforms, though (I guess we could also
check explicitly for "errno == 0", but I have a feeling that many errors
may return errno==0 on your platform).

Can you confirm that works? I suppose we can wrap it in an #ifdef.

-Peff
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to