diff --git a/src/socket_wrapper.c b/src/socket_wrapper.c index ef87519a19c96e8fa7ba200185637e4ef8dc3f46..5804e936ff791953d040301a7a8106b004cd30ad 100644 --- a/src/socket_wrapper.c +++ b/src/socket_wrapper.c @@ -3815,7 +3815,6 @@ static int swrap_auto_bind(int fd, struct socket_info *si, int family) char type; int ret; int port; - struct stat st; char *swrap_dir = NULL; swrap_mutex_lock(&autobind_start_mutex); @@ -3916,10 +3915,12 @@ static int swrap_auto_bind(int fd, struct socket_info *si, int family) type, socket_wrapper_default_iface(), port); - if (stat(un_addr.sa.un.sun_path, &st) == 0) continue; ret = libc_bind(fd, &un_addr.sa.s, un_addr.sa_socklen); if (ret == -1) { + if (errno == EALREADY || errno == EADDRINUSE) { + continue; + } goto done; }