diff --git a/src/sfxd.c b/src/sfxd.c index f4be5d8..1f8395e 100644 --- a/src/sfxd.c +++ b/src/sfxd.c @@ -1,5 +1,6 @@ #include "common.h" #include "miniaudio.h" +#include #include #include #include @@ -9,6 +10,7 @@ #include #include #include +#include #include #include @@ -105,6 +107,13 @@ int main(int argc, char **argv) { } } + { + struct stat statbuf; + int status = stat(sock_path, &statbuf); + if (status == 0 && !S_ISSOCK(statbuf.st_mode)) { + PANIC("Specified sock_path is not a socket"); + } + } if (!ipc_init(sock_path)) { unlink(sock_path);