diff options
| author | 2021-06-29 04:21:25 +0200 | |
|---|---|---|
| committer | 2021-06-29 04:21:25 +0200 | |
| commit | 8567650b1c2f44e2c53fb54b0e916ee3a0869add (patch) | |
| tree | c9bc011956a7f7019796996bb72cd5f99673301b /src/dfu.c | |
| parent | b09706b48b00d00cfd61638d9e9b932484b29b79 (diff) | |
| download | idevicerestore-8567650b1c2f44e2c53fb54b0e916ee3a0869add.tar.gz idevicerestore-8567650b1c2f44e2c53fb54b0e916ee3a0869add.tar.bz2  | |
Make device mode specific code more consistent
Diffstat (limited to 'src/dfu.c')
| -rw-r--r-- | src/dfu.c | 12 | 
1 files changed, 6 insertions, 6 deletions
@@ -399,7 +399,7 @@ int dfu_enter_recovery(struct idevicerestore_client_t* client, plist_t build_ide  	if (mode != IRECV_K_DFU_MODE) {  		info("NOTE: device is not in DFU mode, assuming recovery mode.\n"); -		client->mode = &idevicerestore_modes[MODE_RECOVERY]; +		client->mode = MODE_RECOVERY;  		return 0;  	} @@ -417,7 +417,7 @@ int dfu_enter_recovery(struct idevicerestore_client_t* client, plist_t build_ide  		/* reconnect */  		debug("Waiting for device to disconnect...\n");  		cond_wait_timeout(&client->device_event_cond, &client->device_event_mutex, 10000); -		if (client->mode != &idevicerestore_modes[MODE_UNKNOWN] || (client->flags & FLAG_QUIT)) { +		if (client->mode != MODE_UNKNOWN || (client->flags & FLAG_QUIT)) {  			mutex_unlock(&client->device_event_mutex);  			if (!(client->flags & FLAG_QUIT)) {  				error("ERROR: Device did not disconnect. Possibly invalid iBSS. Reset device and try again.\n"); @@ -426,7 +426,7 @@ int dfu_enter_recovery(struct idevicerestore_client_t* client, plist_t build_ide  		}  		debug("Waiting for device to reconnect...\n");  		cond_wait_timeout(&client->device_event_cond, &client->device_event_mutex, 10000); -		if ((client->mode != &idevicerestore_modes[MODE_DFU] && client->mode != &idevicerestore_modes[MODE_RECOVERY]) || (client->flags & FLAG_QUIT)) { +		if ((client->mode != MODE_DFU && client->mode != MODE_RECOVERY) || (client->flags & FLAG_QUIT)) {  			mutex_unlock(&client->device_event_mutex);  			if (!(client->flags & FLAG_QUIT)) {  				error("ERROR: Device did not reconnect in DFU or recovery mode. Possibly invalid iBSS. Reset device and try again.\n"); @@ -560,7 +560,7 @@ int dfu_enter_recovery(struct idevicerestore_client_t* client, plist_t build_ide  			return -1;  		} -		if (client->mode == &idevicerestore_modes[MODE_RECOVERY]) { +		if (client->mode == MODE_RECOVERY) {  			sleep(1);  			if (irecv_send_command_breq(client->dfu->client, "go", 1) != IRECV_E_SUCCESS) {  				mutex_unlock(&client->device_event_mutex); @@ -577,7 +577,7 @@ int dfu_enter_recovery(struct idevicerestore_client_t* client, plist_t build_ide  	debug("Waiting for device to disconnect...\n");  	cond_wait_timeout(&client->device_event_cond, &client->device_event_mutex, 10000); -	if (client->mode != &idevicerestore_modes[MODE_UNKNOWN] || (client->flags & FLAG_QUIT)) { +	if (client->mode != MODE_UNKNOWN || (client->flags & FLAG_QUIT)) {  		mutex_unlock(&client->device_event_mutex);  		if (!(client->flags & FLAG_QUIT)) {  			error("ERROR: Device did not disconnect. Possibly invalid %s. Reset device and try again.\n", (client->build_major > 8) ? "iBEC" : "iBSS"); @@ -586,7 +586,7 @@ int dfu_enter_recovery(struct idevicerestore_client_t* client, plist_t build_ide  	}  	debug("Waiting for device to reconnect in recovery mode...\n");  	cond_wait_timeout(&client->device_event_cond, &client->device_event_mutex, 10000); -	if (client->mode != &idevicerestore_modes[MODE_RECOVERY] || (client->flags & FLAG_QUIT)) { +	if (client->mode != MODE_RECOVERY || (client->flags & FLAG_QUIT)) {  		mutex_unlock(&client->device_event_mutex);  		if (!(client->flags & FLAG_QUIT)) {  			error("ERROR: Device did not reconnect in recovery mode. Possibly invalid %s. Reset device and try again.\n", (client->build_major > 8) ? "iBEC" : "iBSS");  | 
