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:
parent
7ab1b2a97a
commit
46b799c077
1 changed files with 1 additions and 1 deletions
2
passt.c
2
passt.c
|
@ -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;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue