summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAmit Shah <amit.shah@redhat.com>2010-09-30 13:51:53 +0530
committerAmit Shah <amit.shah@redhat.com>2010-09-30 13:51:53 +0530
commitc5abfb12671114a65470f8b6131a7dd73f2e5e81 (patch)
tree2743e35c0e867cb34f25a714fa865b00bb85c755
parent692adad718e7655203768ae0d16f52b0cabeb91f (diff)
downloadtest-virtserial-c5abfb12671114a65470f8b6131a7dd73f2e5e81.tar.gz
test-virtserial-c5abfb12671114a65470f8b6131a7dd73f2e5e81.tar.xz
test-virtserial-c5abfb12671114a65470f8b6131a7dd73f2e5e81.zip
auto-test: Close guest file descriptor if a test left it open
A test might lazily not close open guest file descriptors (like the older test_open() did on purpose or the test_multiple_open() does for laziness). Ensure we close the fd and also clear out the buffers if there were any queued up. Signed-off-by: Amit Shah <amit.shah@redhat.com>
-rw-r--r--auto-virtserial.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/auto-virtserial.c b/auto-virtserial.c
index 7faccbb..1428f0d 100644
--- a/auto-virtserial.c
+++ b/auto-virtserial.c
@@ -1525,7 +1525,7 @@ static void post_test_cleanup(int nr)
if (!guest_ok)
goto skip_guest;
ret = guest_open_port(nr);
- if (ret < 0)
+ if (ret < 0 && ret != -EMFILE)
goto skip_guest;
while ((ret = guest_poll(nr, 0, 0))) {
if ((ret > 0) && (ret & POLLIN)) {