X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=lib%2Fsocket-util.c;h=ed19013020cb8dae903ab91ec128819de6f7b57d;hb=8419883d698965962e37b024cfb7f2f0ccba376f;hp=e6a6c70ef836b9a370bd9fffb64fc7cf3844b409;hpb=58fda1dab104041fc693032475ec4662c1a52849;p=openvswitch diff --git a/lib/socket-util.c b/lib/socket-util.c index e6a6c70e..ed190130 100644 --- a/lib/socket-util.c +++ b/lib/socket-util.c @@ -249,6 +249,7 @@ make_unix_socket(int style, bool nonblock, bool passcred UNUSED, make_sockaddr_un(connect_path, &un, &un_len); if (connect(fd, (struct sockaddr*) &un, un_len) && errno != EINPROGRESS) { + printf("connect failed with %s\n", strerror(errno)); goto error; } } @@ -265,10 +266,10 @@ make_unix_socket(int style, bool nonblock, bool passcred UNUSED, return fd; error: + error = errno == EAGAIN ? EPROTO : errno; if (bind_path) { fatal_signal_remove_file_to_unlink(bind_path); } - error = errno; close(fd); return -error; }