summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Nikias Bassen2010-08-07 02:05:40 +0200
committerGravatar Martin Szulecki2010-10-04 00:33:15 +0200
commite6cdcf5fecf2ee71b383b8804d9d0322b1db446b (patch)
tree7037ba5ff5d632a9b4cce9102e111507ac1fc0f4
parentb6b2f911500c2e7d80dc14a148710986272da609 (diff)
downloadlibimobiledevice-e6cdcf5fecf2ee71b383b8804d9d0322b1db446b.tar.gz
libimobiledevice-e6cdcf5fecf2ee71b383b8804d9d0322b1db446b.tar.bz2
idevicesyslog: terminate on receive errors (e.g. device unplugging)
-rw-r--r--tools/idevicesyslog.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/tools/idevicesyslog.c b/tools/idevicesyslog.c
index dcd8df6..f2b3a2f 100644
--- a/tools/idevicesyslog.c
+++ b/tools/idevicesyslog.c
@@ -118,6 +118,11 @@ int main(int argc, char *argv[])
uint32_t datalen = 0, bytes = 0, recv_bytes = 0;
ret = idevice_connection_receive(conn, (char *) &datalen, sizeof(datalen), &bytes);
+ if (ret < 0) {
+ fprintf(stderr, "Error receiving data. Exiting...\n");
+ break;
+ }
+
datalen = GUINT32_FROM_BE(datalen);
if (datalen == 0)