summaryrefslogtreecommitdiff
path: root/saedit/config.c
diff options
context:
space:
mode:
authorVasily_Makarov <danilka.pro@gmail.com>2011-10-19 23:49:08 +0400
committerVasily_Makarov <danilka.pro@gmail.com>2011-10-19 23:49:08 +0400
commit95213c9cdb04d1791d55c231331467edce9ab722 (patch)
tree41e73ce4fe85d54bd35af01e88dc77334ef64181 /saedit/config.c
parent580c082d81b21c34886ab59905239eb64449378f (diff)
downloadevol-tools-95213c9cdb04d1791d55c231331467edce9ab722.tar.gz
evol-tools-95213c9cdb04d1791d55c231331467edce9ab722.tar.bz2
evol-tools-95213c9cdb04d1791d55c231331467edce9ab722.tar.xz
evol-tools-95213c9cdb04d1791d55c231331467edce9ab722.zip
Correct config loading/saving
Diffstat (limited to 'saedit/config.c')
-rw-r--r--saedit/config.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/saedit/config.c b/saedit/config.c
index 98a1325..f28ab54 100644
--- a/saedit/config.c
+++ b/saedit/config.c
@@ -56,10 +56,13 @@ void config_keys_save(Keys *keys) {
POSTFIX_FOLDER,
NULL));
g_key_file_set_boolean(key_file, "General", "ShowGrid", keys->show_grid);
- g_file_set_contents(KEYS_CONFIG_FILE,
- g_key_file_to_data(key_file, NULL, NULL),
- -1,
- NULL);
+
+ mkdir(KEYS_CONFIG_DIR, S_IRWXU);
+ int fd = g_creat(KEYS_CONFIG_FILE, S_IREAD | S_IWRITE);
+ gchar *buf = g_key_file_to_data(key_file, NULL, NULL);
+ write(fd, buf, strlen(buf), NULL);
+ close(fd);
+
g_key_file_free(key_file);
}