summaryrefslogtreecommitdiffstats
path: root/src/normal.c
diff options
context:
space:
mode:
authorGravatar BALATON Zoltan2017-02-09 00:37:06 +0100
committerGravatar BALATON Zoltan2017-11-13 22:12:44 +0100
commita87ce4efcbdb9ad3aff3eb52ee9fd9da8e4ab922 (patch)
tree78dba41813b8037db98212a8647ec4bf940b2fc7 /src/normal.c
parent08d610d5811ed0aa3fecf48ff9e9cee2190b1981 (diff)
downloadidevicerestore-a87ce4efcbdb9ad3aff3eb52ee9fd9da8e4ab922.tar.gz
idevicerestore-a87ce4efcbdb9ad3aff3eb52ee9fd9da8e4ab922.tar.bz2
Change check_hardware_model() to get_irecv_device()
The check_hardware_model() function has a misleading name. It returns a string with the hardware model but this is not used. Instead, this function is only called for its side effect to initialise an irecv device in the passed client struct which it creates from the hardware model name returned by mode specific implementations. But these mode specific implementations already create an irecv device to get the hardware model name so instead of going through this unnecessary complication just return the irecv device directly and rename the function accordingly to make this clear. (This may also prevent leaking an irecv device in the mode specific functions.)
Diffstat (limited to 'src/normal.c')
-rw-r--r--src/normal.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/normal.c b/src/normal.c
index 8101b72..921a157 100644
--- a/src/normal.c
+++ b/src/normal.c
@@ -218,7 +218,7 @@ int normal_open_with_timeout(struct idevicerestore_client_t* client) {
return 0;
}
-const char* normal_check_hardware_model(struct idevicerestore_client_t* client) {
+irecv_device_t normal_get_irecv_device(struct idevicerestore_client_t* client) {
idevice_t device = NULL;
lockdownd_client_t lockdown = NULL;
lockdownd_error_t lockdown_error = LOCKDOWN_E_SUCCESS;
@@ -253,7 +253,7 @@ const char* normal_check_hardware_model(struct idevicerestore_client_t* client)
lockdownd_client_free(lockdown);
idevice_free(device);
- return (irecv_device) ? irecv_device->hardware_model : NULL;
+ return irecv_device;
}
int normal_enter_recovery(struct idevicerestore_client_t* client) {