#include <sys/socket.h>
#include <sys/un.h>
+#include <sys/stat.h>
#include "main.h"
}
int ConnectToInstance(const char *path) {
+ struct stat s;
+ if(stat(path, &s)) {
+ if(errno != ENOENT) {
+ fprintf(stderr, "cannot stat file %s: %s", path, strerror(errno));
+ }
+ return -1;
+ }
+
int fd = socket(AF_UNIX, SOCK_STREAM, 0);
if(!fd) {
return -1;
static void FileQuitCB(Widget w, void *udata, void *cdata) {
WindowClosePlayer(main_window);
+ ShutdownInstanceSocket(XtDisplay(w));
ApplicationExit();
}