diff options
author | Nikias Bassen | 2010-08-07 02:05:40 +0200 |
---|---|---|
committer | Nikias Bassen | 2010-08-07 02:05:40 +0200 |
commit | d133d337087ebb3171596c428715821eb0780ff5 (patch) | |
tree | ef79e11e3234bbf2c153316388c991843a6ad785 /tools | |
parent | b55329772d632f45bad7f84b4aec964c335e406d (diff) | |
download | libimobiledevice-d133d337087ebb3171596c428715821eb0780ff5.tar.gz libimobiledevice-d133d337087ebb3171596c428715821eb0780ff5.tar.bz2 |
idevicesyslog: terminate on receive errors (e.g. device unplugging)
Diffstat (limited to 'tools')
-rw-r--r-- | tools/idevicesyslog.c | 5 |
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) |