Skip to content

Commit 01c94c7

Browse files
committed
conf: Fix false plist read/write errors caused by using new libplist API
Thanks to @intelfx for spotting this.
1 parent 049877e commit 01c94c7

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/conf.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -257,7 +257,7 @@ static int internal_set_value(const char *config_file, const char *key, plist_t
257257
usbmuxd_log(LL_DEBUG, "Setting key %s in config file %s", key, config_file);
258258
}
259259

260-
int res = plist_write_to_file(config, config_file, PLIST_FORMAT_XML, 0);
260+
int res = (plist_write_to_file(config, config_file, PLIST_FORMAT_XML, 0) == PLIST_ERR_SUCCESS);
261261

262262
plist_free(config);
263263

@@ -277,7 +277,7 @@ static int config_set_value(const char *key, plist_t value)
277277

278278
int result = internal_set_value(config_file, key, value);
279279
if (!result) {
280-
usbmuxd_log(LL_ERROR, "ERROR: Failed to write to '%s': %s", config_file, strerror(errno));
280+
usbmuxd_log(LL_ERROR, "ERROR: Failed to write to '%s'", config_file);
281281
}
282282

283283
free(config_file);
@@ -291,7 +291,7 @@ static int internal_get_value(const char* config_file, const char *key, plist_t
291291

292292
/* now parse file to get the SystemBUID */
293293
plist_t config = NULL;
294-
if (plist_read_from_file(config_file, &config, NULL)) {
294+
if (plist_read_from_file(config_file, &config, NULL) == PLIST_ERR_SUCCESS) {
295295
usbmuxd_log(LL_DEBUG, "Reading key %s from config file %s", key, config_file);
296296
plist_t n = plist_dict_get_item(config, key);
297297
if (n) {

0 commit comments

Comments
 (0)