Lines 255-261
static int internal_set_value(const char *config_file, const char *key, plist_t
Link Here
|
255 |
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); |
256 |
} |
256 |
} |
257 |
|
257 |
|
258 |
int res = plist_write_to_file(config, config_file, PLIST_FORMAT_XML, 0); |
258 |
int res = (plist_write_to_file(config, config_file, PLIST_FORMAT_XML, 0) == PLIST_ERR_SUCCESS); |
259 |
|
259 |
|
260 |
plist_free(config); |
260 |
plist_free(config); |
261 |
|
261 |
|
Lines 275-281
static int config_set_value(const char *key, plist_t value)
Link Here
|
275 |
|
275 |
|
276 |
int result = internal_set_value(config_file, key, value); |
276 |
int result = internal_set_value(config_file, key, value); |
277 |
if (!result) { |
277 |
if (!result) { |
278 |
usbmuxd_log(LL_ERROR, "ERROR: Failed to write to '%s': %s", config_file, strerror(errno)); |
278 |
usbmuxd_log(LL_ERROR, "ERROR: Failed to write to '%s'", config_file); |
279 |
} |
279 |
} |
280 |
|
280 |
|
281 |
free(config_file); |
281 |
free(config_file); |
Lines 289-295
static int internal_get_value(const char* config_file, const char *key, plist_t
Link Here
|
289 |
|
289 |
|
290 |
/* now parse file to get the SystemBUID */ |
290 |
/* now parse file to get the SystemBUID */ |
291 |
plist_t config = NULL; |
291 |
plist_t config = NULL; |
292 |
if (plist_read_from_file(config_file, &config, NULL)) { |
292 |
if (plist_read_from_file(config_file, &config, NULL) == PLIST_ERR_SUCCESS) { |
293 |
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); |
294 |
plist_t n = plist_dict_get_item(config, key); |
294 |
plist_t n = plist_dict_get_item(config, key); |
295 |
if (n) { |
295 |
if (n) { |