diff options
author | Martin Szulecki | 2013-05-24 01:43:08 +0200 |
---|---|---|
committer | Martin Szulecki | 2013-05-24 01:43:08 +0200 |
commit | 15c7079984fff9e5cbdef070dca584ca761793dc (patch) | |
tree | 11496df970ed5d60f740d1f6588e95aa31240ee6 /src/syslog_relay.c | |
parent | 0701c787ea0e7bad71bfe52e977f027ab229c75a (diff) | |
download | libimobiledevice-15c7079984fff9e5cbdef070dca584ca761793dc.tar.gz libimobiledevice-15c7079984fff9e5cbdef070dca584ca761793dc.tar.bz2 |
syslog_relay: Make sure syslog worker thread is not stuck forever
Diffstat (limited to 'src/syslog_relay.c')
-rw-r--r-- | src/syslog_relay.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/syslog_relay.c b/src/syslog_relay.c index f1231e1..2936700 100644 --- a/src/syslog_relay.c +++ b/src/syslog_relay.c @@ -211,8 +211,10 @@ void *syslog_relay_worker(void *arg) while (srwt->client->parent) { char c; uint32_t bytes = 0; - ret = syslog_relay_receive_with_timeout(srwt->client, &c, 1, &bytes, 0); - if (ret < 0 || (bytes != 1)) { + ret = syslog_relay_receive_with_timeout(srwt->client, &c, 1, &bytes, 100); + if ((bytes == 0) && (ret == SYSLOG_RELAY_E_SUCCESS)) { + continue; + } else if (ret < 0) { debug_info("Connection to syslog relay interrupted"); break; } |