diff --git a/src/main/db.c b/src/main/db.c index 33514ab..bbe8490 100644 --- a/src/main/db.c +++ b/src/main/db.c @@ -79,13 +79,16 @@ sqlite3* get_db() { void notify_change() { char* socket_path = get_socket_path(); - FILE* fp = fopen(socket_path, "r"); - - int pid; - fscanf(fp, "%d", &pid); // Trigger IN_ACCESS - (void)pid; + if (access(socket_path, F_OK) == 0) { + FILE* fp = fopen(socket_path, "r"); - fclose(fp); + int pid; + fscanf(fp, "%d", &pid); // Trigger IN_ACCESS + (void)pid; + + fclose(fp); + } + free(socket_path); }