diff options
| author | 2013-09-24 03:36:35 +0200 | |
|---|---|---|
| committer | 2013-09-24 03:36:35 +0200 | |
| commit | 9b33c64b51c8bd216ba4e4483f445f61efe257f7 (patch) | |
| tree | ed98fc263638133edbce2eecaab4d99051962f70 | |
| parent | a1fc3913b30a5b078ce73228e3a5e96416fb8059 (diff) | |
| download | libimobiledevice-9b33c64b51c8bd216ba4e4483f445f61efe257f7.tar.gz libimobiledevice-9b33c64b51c8bd216ba4e4483f445f61efe257f7.tar.bz2 | |
userpref: return error if remove in userpref_remove_device_record fails
| -rw-r--r-- | common/userpref.c | 10 |
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 | |||
| 584 | */ | 584 | */ |
| 585 | userpref_error_t userpref_remove_device_record(const char *udid) | 585 | userpref_error_t userpref_remove_device_record(const char *udid) |
| 586 | { | 586 | { |
| 587 | userpref_error_t res = USERPREF_E_SUCCESS; | ||
| 587 | if (!userpref_has_device_record(udid)) | 588 | if (!userpref_has_device_record(udid)) |
| 588 | return USERPREF_E_SUCCESS; | 589 | return res; |
| 589 | 590 | ||
| 590 | /* build file path */ | 591 | /* build file path */ |
| 591 | const char *config_path = userpref_get_config_dir(); | 592 | const char *config_path = userpref_get_config_dir(); |
| 592 | char *device_record_file = string_concat(config_path, DIR_SEP_S, udid, USERPREF_CONFIG_EXTENSION, NULL); | 593 | char *device_record_file = string_concat(config_path, DIR_SEP_S, udid, USERPREF_CONFIG_EXTENSION, NULL); |
| 593 | 594 | ||
| 594 | /* remove file */ | 595 | /* remove file */ |
| 595 | remove(device_record_file); | 596 | if (remove(device_record_file) != 0) { |
| 597 | debug_info("could not remove %s: %s\n", device_record_file, strerror(errno)); | ||
| 598 | res = USERPREF_E_UNKNOWN_ERROR; | ||
| 599 | } | ||
| 596 | 600 | ||
| 597 | free(device_record_file); | 601 | free(device_record_file); |
| 598 | 602 | ||
| 599 | return USERPREF_E_SUCCESS; | 603 | return res; |
| 600 | } | 604 | } |
| 601 | 605 | ||
| 602 | #if 0 | 606 | #if 0 |
