[gnome-settings-daemon/benzea/ci-fixes: 11/11] tests: Fix close of invalid file descriptor
- From: Benjamin Berg <bberg src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-settings-daemon/benzea/ci-fixes: 11/11] tests: Fix close of invalid file descriptor
- Date: Thu, 22 Jul 2021 08:31:33 +0000 (UTC)
commit 1e3804c1f38e85cfbf9af4cfc52a26d738e6cf35
Author: Benjamin Berg <bberg redhat com>
Date: Wed Jul 21 12:36:55 2021 +0200
tests: Fix close of invalid file descriptor
The file descriptor may have been closed (and set to -1) already, catch
this.
tests/output_checker.py | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
---
diff --git a/tests/output_checker.py b/tests/output_checker.py
index 26f9217c..1680c2dc 100644
--- a/tests/output_checker.py
+++ b/tests/output_checker.py
@@ -67,7 +67,8 @@ class OutputChecker(object):
continue
# We get a bad file descriptor error when the outside closes the FD
- os.close(self._pipe_fd_r)
+ if self._pipe_fd_r >= 0:
+ os.close(self._pipe_fd_r)
self._pipe_fd_r = -1
self._lines_sem.release()
return
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]