chiark / gitweb /
darwin and stupidity fixes for speaker socket move
authorRichard Kettlewell <rjk@greenend.org.uk>
Sun, 23 Dec 2007 10:28:08 +0000 (10:28 +0000)
committerRichard Kettlewell <rjk@greenend.org.uk>
Sun, 23 Dec 2007 10:28:08 +0000 (10:28 +0000)
server/speaker.c

index e4a00be..8a3eb06 100644 (file)
@@ -69,6 +69,7 @@
 #include <fcntl.h>
 #include <poll.h>
 #include <sys/un.h>
+#include <sys/stat.h>
 
 #include "configuration.h"
 #include "syscalls.h"
@@ -644,7 +645,7 @@ int main(int argc, char **argv) {
   /* create the socket directory */
   byte_xasprintf(&dir, "%s/speaker", config->home);
   unlink(dir);                          /* might be a leftover socket */
-  if(mkdir(dir, 0700) < 0)
+  if(mkdir(dir, 0700) < 0 && errno != EEXIST)
     fatal(errno, "error creating %s", dir);
   /* set up the listen socket */
   listenfd = xsocket(PF_UNIX, SOCK_STREAM, 0);