diff options
author | Amit Shah <amit.shah@redhat.com> | 2010-09-16 13:06:05 +0530 |
---|---|---|
committer | Amit Shah <amit.shah@redhat.com> | 2010-09-16 16:04:42 +0530 |
commit | 8d7a337d72579fbb4b28e361a890e5936673a52d (patch) | |
tree | bfe4774cd6d73dee2d12c343a0bd29daf6f7afa5 | |
parent | 568884961a5925457d746055964aeaf339d22164 (diff) | |
download | test-virtserial-8d7a337d72579fbb4b28e361a890e5936673a52d.tar.gz test-virtserial-8d7a337d72579fbb4b28e361a890e5936673a52d.tar.xz test-virtserial-8d7a337d72579fbb4b28e361a890e5936673a52d.zip |
auto-test: don't poll further if last read() returned 0 in cleanup
Signed-off-by: Amit Shah <amit.shah@redhat.com>
-rw-r--r-- | auto-virtserial.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/auto-virtserial.c b/auto-virtserial.c index e9c238e..78c35bc 100644 --- a/auto-virtserial.c +++ b/auto-virtserial.c @@ -1501,10 +1501,12 @@ static void post_test_cleanup(int nr) if (ret < 0) goto skip_guest; while ((ret = guest_poll(nr, 0, 0))) { - if ((ret > 0) && (ret & POLLIN)) - guest_read(nr, BUF_LENGTH); - else + if ((ret > 0) && (ret & POLLIN)) { + if (!guest_read(nr, BUF_LENGTH)) + break; + } else { break; + } } guest_close_port(nr); |