passt: When probing for an existing instance, also accept ENOENT on connect()

The most common case is actually that no other instance created a
socket with that name -- and that also means there is no other
instance.

Signed-off-by: Stefano Brivio <sbrivio@redhat.com>
This commit is contained in:
Stefano Brivio 2021-05-23 15:36:53 +02:00
parent 7ab1b2a97a
commit 46b799c077

View file

@ -104,7 +104,7 @@ static int sock_unix(int *index)
ex = socket(AF_UNIX, SOCK_STREAM | SOCK_NONBLOCK, 0); ex = socket(AF_UNIX, SOCK_STREAM | SOCK_NONBLOCK, 0);
ret = connect(ex, (const struct sockaddr *)&addr, sizeof(addr)); ret = connect(ex, (const struct sockaddr *)&addr, sizeof(addr));
if (!ret || errno != ECONNREFUSED) { if (!ret || (errno != ENOENT && errno != ECONNREFUSED)) {
close(ex); close(ex);
continue; continue;
} }