Lines 39-44
Link Here
|
39 |
#include <shlobj.h> |
39 |
#include <shlobj.h> |
40 |
#endif |
40 |
#endif |
41 |
|
41 |
|
|
|
42 |
#include <plist/plist.h> |
42 |
#include "conf.h" |
43 |
#include "conf.h" |
43 |
#include "utils.h" |
44 |
#include "utils.h" |
44 |
#include "log.h" |
45 |
#include "log.h" |
Lines 230-236
static int internal_set_value(const char *config_file, const char *key, plist_t
Link Here
|
230 |
/* read file into plist */ |
231 |
/* read file into plist */ |
231 |
plist_t config = NULL; |
232 |
plist_t config = NULL; |
232 |
|
233 |
|
233 |
plist_read_from_filename(&config, config_file); |
234 |
plist_read_from_file(config_file, &config, NULL); |
234 |
if (!config) { |
235 |
if (!config) { |
235 |
config = plist_new_dict(); |
236 |
config = plist_new_dict(); |
236 |
plist_dict_set_item(config, key, value); |
237 |
plist_dict_set_item(config, key, value); |
Lines 254-260
static int internal_set_value(const char *config_file, const char *key, plist_t
Link Here
|
254 |
usbmuxd_log(LL_DEBUG, "Setting key %s in config file %s", key, config_file); |
255 |
usbmuxd_log(LL_DEBUG, "Setting key %s in config file %s", key, config_file); |
255 |
} |
256 |
} |
256 |
|
257 |
|
257 |
int res = plist_write_to_filename(config, config_file, PLIST_FORMAT_XML); |
258 |
int res = plist_write_to_file(config, config_file, PLIST_FORMAT_XML, 0); |
258 |
|
259 |
|
259 |
plist_free(config); |
260 |
plist_free(config); |
260 |
|
261 |
|
Lines 288-294
static int internal_get_value(const char* config_file, const char *key, plist_t
Link Here
|
288 |
|
289 |
|
289 |
/* now parse file to get the SystemBUID */ |
290 |
/* now parse file to get the SystemBUID */ |
290 |
plist_t config = NULL; |
291 |
plist_t config = NULL; |
291 |
if (plist_read_from_filename(&config, config_file)) { |
292 |
if (plist_read_from_file(config_file, &config, NULL)) { |
292 |
usbmuxd_log(LL_DEBUG, "Reading key %s from config file %s", key, config_file); |
293 |
usbmuxd_log(LL_DEBUG, "Reading key %s from config file %s", key, config_file); |
293 |
plist_t n = plist_dict_get_item(config, key); |
294 |
plist_t n = plist_dict_get_item(config, key); |
294 |
if (n) { |
295 |
if (n) { |
Lines 428-434
int config_set_device_record(const char *udid, char* record_data, uint64_t recor
Link Here
|
428 |
remove(device_record_file); |
429 |
remove(device_record_file); |
429 |
|
430 |
|
430 |
/* store file */ |
431 |
/* store file */ |
431 |
if (!plist_write_to_filename(plist, device_record_file, PLIST_FORMAT_XML)) { |
432 |
if (!plist_write_to_file(plist, device_record_file, PLIST_FORMAT_XML, 0)) { |
432 |
usbmuxd_log(LL_DEBUG, "Could not open '%s' for writing: %s", device_record_file, strerror(errno)); |
433 |
usbmuxd_log(LL_DEBUG, "Could not open '%s' for writing: %s", device_record_file, strerror(errno)); |
433 |
res = -ENOENT; |
434 |
res = -ENOENT; |
434 |
} |
435 |
} |