diff options
Diffstat (limited to 'src/conf.c')
-rw-r--r-- | src/conf.c | 9 |
1 files changed, 5 insertions, 4 deletions
@@ -40,6 +40,7 @@ | |||
40 | #endif | 40 | #endif |
41 | 41 | ||
42 | #include <libimobiledevice-glue/utils.h> | 42 | #include <libimobiledevice-glue/utils.h> |
43 | #include <plist/plist.h> | ||
43 | 44 | ||
44 | #include "conf.h" | 45 | #include "conf.h" |
45 | #include "utils.h" | 46 | #include "utils.h" |
@@ -232,7 +233,7 @@ static int internal_set_value(const char *config_file, const char *key, plist_t | |||
232 | /* read file into plist */ | 233 | /* read file into plist */ |
233 | plist_t config = NULL; | 234 | plist_t config = NULL; |
234 | 235 | ||
235 | plist_read_from_filename(&config, config_file); | 236 | plist_read_from_file(config_file, &config, NULL); |
236 | if (!config) { | 237 | if (!config) { |
237 | config = plist_new_dict(); | 238 | config = plist_new_dict(); |
238 | plist_dict_set_item(config, key, value); | 239 | plist_dict_set_item(config, key, value); |
@@ -256,7 +257,7 @@ static int internal_set_value(const char *config_file, const char *key, plist_t | |||
256 | usbmuxd_log(LL_DEBUG, "Setting key %s in config file %s", key, config_file); | 257 | usbmuxd_log(LL_DEBUG, "Setting key %s in config file %s", key, config_file); |
257 | } | 258 | } |
258 | 259 | ||
259 | int res = plist_write_to_filename(config, config_file, PLIST_FORMAT_XML); | 260 | int res = plist_write_to_file(config, config_file, PLIST_FORMAT_XML, 0); |
260 | 261 | ||
261 | plist_free(config); | 262 | plist_free(config); |
262 | 263 | ||
@@ -290,7 +291,7 @@ static int internal_get_value(const char* config_file, const char *key, plist_t | |||
290 | 291 | ||
291 | /* now parse file to get the SystemBUID */ | 292 | /* now parse file to get the SystemBUID */ |
292 | plist_t config = NULL; | 293 | plist_t config = NULL; |
293 | if (plist_read_from_filename(&config, config_file)) { | 294 | if (plist_read_from_file(config_file, &config, NULL)) { |
294 | usbmuxd_log(LL_DEBUG, "Reading key %s from config file %s", key, config_file); | 295 | usbmuxd_log(LL_DEBUG, "Reading key %s from config file %s", key, config_file); |
295 | plist_t n = plist_dict_get_item(config, key); | 296 | plist_t n = plist_dict_get_item(config, key); |
296 | if (n) { | 297 | if (n) { |
@@ -430,7 +431,7 @@ int config_set_device_record(const char *udid, char* record_data, uint64_t recor | |||
430 | remove(device_record_file); | 431 | remove(device_record_file); |
431 | 432 | ||
432 | /* store file */ | 433 | /* store file */ |
433 | if (!plist_write_to_filename(plist, device_record_file, PLIST_FORMAT_XML)) { | 434 | if (!plist_write_to_file(plist, device_record_file, PLIST_FORMAT_XML, 0)) { |
434 | usbmuxd_log(LL_DEBUG, "Could not open '%s' for writing: %s", device_record_file, strerror(errno)); | 435 | usbmuxd_log(LL_DEBUG, "Could not open '%s' for writing: %s", device_record_file, strerror(errno)); |
435 | res = -ENOENT; | 436 | res = -ENOENT; |
436 | } | 437 | } |