mirror of
https://github.com/clearlinux/linux-steam-integration.git
synced 2026-10-04 16:08:24 +00:00
lsi: When ~/.config doesn't exist, create it
This helps with problems under snapd build which fails to correctly store settings on exit, due to a missing directory. This is part of the ongoing work for issue #30. Signed-off-by: Ikey Doherty <ikey@solus-project.com>
This commit is contained in:
@@ -147,11 +147,23 @@ bool lsi_config_store(LsiConfig *config)
|
||||
{
|
||||
autofree(FILE) *fp = NULL;
|
||||
autofree(char) *conf = NULL;
|
||||
autofree(char) *dir = NULL;
|
||||
|
||||
if (!config) {
|
||||
return false;
|
||||
}
|
||||
|
||||
/* Ensure we have config directory, i.e. when as a snap.. */
|
||||
dir = lsi_get_user_config_dir();
|
||||
if (!dir) {
|
||||
return false;
|
||||
}
|
||||
if (!lsi_file_exists(dir)) {
|
||||
if (mkdir(dir, 00755) < 0) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
conf = lsi_get_user_config_file();
|
||||
if (!conf) {
|
||||
return false;
|
||||
|
||||
Reference in New Issue
Block a user