summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Nikias Bassen2023-05-05 23:22:37 +0200
committerGravatar Nikias Bassen2023-05-05 23:22:37 +0200
commit01c94c77f59404924f1c46d99c4e5e0c7817281b (patch)
tree060831e2af991c490fbb2a72628b18b613f2a175
parent049877e1f7a54f63fef12dd384c9a22fb38b3514 (diff)
downloadusbmuxd-01c94c77f59404924f1c46d99c4e5e0c7817281b.tar.gz
usbmuxd-01c94c77f59404924f1c46d99c4e5e0c7817281b.tar.bz2
conf: Fix false plist read/write errors caused by using new libplist API
Thanks to @intelfx for spotting this.
-rw-r--r--src/conf.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/conf.c b/src/conf.c
index 3f4507a..2e6c97f 100644
--- a/src/conf.c
+++ b/src/conf.c
@@ -257,7 +257,7 @@ static int internal_set_value(const char *config_file, const char *key, plist_t
usbmuxd_log(LL_DEBUG, "Setting key %s in config file %s", key, config_file);
}
- int res = plist_write_to_file(config, config_file, PLIST_FORMAT_XML, 0);
+ int res = (plist_write_to_file(config, config_file, PLIST_FORMAT_XML, 0) == PLIST_ERR_SUCCESS);
plist_free(config);
@@ -277,7 +277,7 @@ static int config_set_value(const char *key, plist_t value)
int result = internal_set_value(config_file, key, value);
if (!result) {
- usbmuxd_log(LL_ERROR, "ERROR: Failed to write to '%s': %s", config_file, strerror(errno));
+ usbmuxd_log(LL_ERROR, "ERROR: Failed to write to '%s'", config_file);
}
free(config_file);
@@ -291,7 +291,7 @@ static int internal_get_value(const char* config_file, const char *key, plist_t
/* now parse file to get the SystemBUID */
plist_t config = NULL;
- if (plist_read_from_file(config_file, &config, NULL)) {
+ if (plist_read_from_file(config_file, &config, NULL) == PLIST_ERR_SUCCESS) {
usbmuxd_log(LL_DEBUG, "Reading key %s from config file %s", key, config_file);
plist_t n = plist_dict_get_item(config, key);
if (n) {