Elaborate on avoiding XDG_RUNTIME_DIR

This commit is contained in:
Přemysl Eric Janouch 2020-10-26 23:08:28 +01:00
parent f699b89dad
commit ab5ca0cf8b
Signed by: p
GPG Key ID: A0420B94F92B9493
1 changed files with 3 additions and 1 deletions

View File

@ -744,7 +744,9 @@ main(int argc, char *argv[])
g_build_filename(g_get_user_data_dir(), PROJECT_NAME, NULL);
g_mkdir_with_parents(data_path, 0755);
// Bind to a control socket, also ensuring only one instance is running
// Bind to a control socket, also ensuring only one instance is running.
// We're intentionally not using XDG_RUNTIME_DIR so that what is effectively
// the database lock is right next to the database.
gchar *socket_path = g_build_filename(data_path, "socket", NULL);
int socket_fd = socket_init(socket_path);
g_free(socket_path);