#include <fcntl.h>
#include <poll.h>
#include <sys/un.h>
+#include <sys/stat.h>
#include "configuration.h"
#include "syscalls.h"
/* 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);