From bc56e24ba14eaa60f55ffe9c748237ef2c79e142 Mon Sep 17 00:00:00 2001 From: Martin Szulecki Date: Wed, 21 Jul 2010 16:20:50 +0200 Subject: idevicebackup: Give the device time to prepare backup data This change requests the initial backup files more gracefully as the device might need more time to prepare the backup data for bigger backups. Otherwise we cause a crash by attempting to parse a plist message we did not receive yet when the device is busy. --- tools/idevicebackup.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/tools/idevicebackup.c b/tools/idevicebackup.c index 1eb12b0..1119bc0 100644 --- a/tools/idevicebackup.c +++ b/tools/idevicebackup.c @@ -26,6 +26,7 @@ #include #include #include +#include #include #include @@ -681,6 +682,12 @@ int main(int argc, char *argv[]) /* process series of DLSendFile messages */ do { mobilebackup_receive(mobilebackup, &message); + if (!message) { + printf("Device is not ready yet. Going to try again in 2 seconds...\n"); + sleep(2); + continue; + } + node = plist_array_get_item(message, 0); /* get out if we don't get a DLSendFile */ -- cgit v1.1-32-gdbae