summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Nikias Bassen2013-09-24 03:36:35 +0200
committerGravatar Nikias Bassen2013-09-24 03:36:35 +0200
commit9b33c64b51c8bd216ba4e4483f445f61efe257f7 (patch)
treeed98fc263638133edbce2eecaab4d99051962f70
parenta1fc3913b30a5b078ce73228e3a5e96416fb8059 (diff)
downloadlibimobiledevice-9b33c64b51c8bd216ba4e4483f445f61efe257f7.tar.gz
libimobiledevice-9b33c64b51c8bd216ba4e4483f445f61efe257f7.tar.bz2
userpref: return error if remove in userpref_remove_device_record fails
-rw-r--r--common/userpref.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/common/userpref.c b/common/userpref.c
index 5250978..b9920ca 100644
--- a/common/userpref.c
+++ b/common/userpref.c
@@ -584,19 +584,23 @@ userpref_error_t userpref_get_device_record(const char *udid, plist_t *device_re
*/
userpref_error_t userpref_remove_device_record(const char *udid)
{
+ userpref_error_t res = USERPREF_E_SUCCESS;
if (!userpref_has_device_record(udid))
- return USERPREF_E_SUCCESS;
+ return res;
/* build file path */
const char *config_path = userpref_get_config_dir();
char *device_record_file = string_concat(config_path, DIR_SEP_S, udid, USERPREF_CONFIG_EXTENSION, NULL);
/* remove file */
- remove(device_record_file);
+ if (remove(device_record_file) != 0) {
+ debug_info("could not remove %s: %s\n", device_record_file, strerror(errno));
+ res = USERPREF_E_UNKNOWN_ERROR;
+ }
free(device_record_file);
- return USERPREF_E_SUCCESS;
+ return res;
}
#if 0