1
0
mirror of https://passt.top/passt synced 2024-12-22 13:45:32 +00:00

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);
ret = connect(ex, (const struct sockaddr *)&addr, sizeof(addr));
if (!ret || errno != ECONNREFUSED) {
if (!ret || (errno != ENOENT && errno != ECONNREFUSED)) {
close(ex);
continue;
}