keyfile = NULL;
}
+ DBG("loaded keyfile %s", pathname);
return keyfile;
}
if (directory == NULL || (*directory) == '\0') {
g_free(directory);
+ ERR("directory is NULL");
return;
}
if (g_mkdir_with_parents(directory,
S_IRUSR | S_IWUSR | S_IXUSR) != 0) {
g_free(directory);
+ ERR("failed to make directory");
return;
}
}
keydata = g_key_file_to_data(keyfile, &size, &error);
if (g_file_set_contents(pathname, keydata, size, &error) != TRUE) {
- DBG("Unable to save %s, error %s", pathname, error->message);
+ ERR("Unable to save %s, error %s", pathname, error->message);
g_error_free(error);
}
chmod(pathname, S_IRUSR | S_IWUSR);
+ DBG("Successfully saved keyfile %s", pathname);
g_free(keydata);
}