server/admin.c (a_listen): If stat(2) says the socket has gone, then retry.
authorMark Wooding <mdw@distorted.org.uk>
Sun, 13 May 2018 00:56:44 +0000 (01:56 +0100)
committerMark Wooding <mdw@distorted.org.uk>
Fri, 25 Jan 2019 12:10:31 +0000 (12:10 +0000)
This saves us from making an embarrassing `stat failed because ENOENT'
report.

server/admin.c

index acdb973..6ff1418 100644 (file)
@@ -2538,6 +2538,7 @@ again:
     if (errno != ECONNREFUSED)
       die(EXIT_FAILURE, "couldn't bind to address: %s", strerror(e));
     if (stat(sun.sun_path, &st)) {
+      if (errno == ENOENT) { close(fd); goto again; }
       die(EXIT_FAILURE, "couldn't stat `%s': %s",
          sun.sun_path, strerror(errno));
     }