X-Git-Url: https://git.distorted.org.uk/~mdw/disorder/blobdiff_plain/85cb23d7dcfa5449893a11d05586f1097794f3f2..bd8895a87731c72190ea2012f36583f796d4181a:/server/speaker.c diff --git a/server/speaker.c b/server/speaker.c index e4a00be..ae43f12 100644 --- a/server/speaker.c +++ b/server/speaker.c @@ -69,6 +69,7 @@ #include #include #include +#include #include "configuration.h" #include "syscalls.h" @@ -634,17 +635,17 @@ int main(int argc, char **argv) { if(getuid() == 0 || geteuid() == 0) fatal(0, "do not run as root"); /* identify the backend used to play */ for(n = 0; backends[n]; ++n) - if(backends[n]->backend == config->speaker_backend) + if(backends[n]->backend == config->api) break; if(!backends[n]) - fatal(0, "unsupported backend %d", config->speaker_backend); + fatal(0, "unsupported api %d", config->api); backend = backends[n]; /* backend-specific initialization */ backend->init(); /* 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);