diff options
author | Nikias Bassen | 2019-10-20 03:35:34 +0200 |
---|---|---|
committer | Nikias Bassen | 2019-10-20 03:35:34 +0200 |
commit | d04ce021b928644cef3b27e025ffc8dae413cd71 (patch) | |
tree | d7293619867881dc76dabf7b701ff012b4bb4ed6 /src/idevicerestore.c | |
parent | 4086188a6fd124d948807ad57408dbdad7fac511 (diff) | |
download | idevicerestore-d04ce021b928644cef3b27e025ffc8dae413cd71.tar.gz idevicerestore-d04ce021b928644cef3b27e025ffc8dae413cd71.tar.bz2 |
Ignore device add events after device entered restore mode
Diffstat (limited to 'src/idevicerestore.c')
-rw-r--r-- | src/idevicerestore.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/idevicerestore.c b/src/idevicerestore.c index d7f2a85..2e38933 100644 --- a/src/idevicerestore.c +++ b/src/idevicerestore.c @@ -208,6 +208,9 @@ static void idevice_event_cb(const idevice_event_t *event, void *userdata) { struct idevicerestore_client_t *client = (struct idevicerestore_client_t*)userdata; if (event->event == IDEVICE_DEVICE_ADD) { + if (client->ignore_device_add_events) { + return; + } if (normal_check_mode(client) == 0) { mutex_lock(&client->device_event_mutex); client->mode = &idevicerestore_modes[MODE_NORMAL]; @@ -226,6 +229,7 @@ static void idevice_event_cb(const idevice_event_t *event, void *userdata) mutex_lock(&client->device_event_mutex); client->mode = &idevicerestore_modes[MODE_UNKNOWN]; debug("%s: device " FMT_016llx " (udid: %s) disconnected\n", __func__, client->ecid, client->udid); + client->ignore_device_add_events = 0; cond_signal(&client->device_event_cond); mutex_unlock(&client->device_event_mutex); } @@ -1309,6 +1313,7 @@ int idevicerestore_start(struct idevicerestore_client_t* client) // device is finally in restore mode, let's do this if (client->mode->index == MODE_RESTORE) { + client->ignore_device_add_events = 1; info("About to restore device... \n"); result = restore_device(client, build_identity, filesystem); if (result < 0) { |