Skip to content

Commit

Permalink
Do not close stdin, stdout, or stderr
Browse files Browse the repository at this point in the history
Instead, point them at /dev/null.  Closing standard file descriptors is
almost always a bug, and in this case causes a hang in the tests.
  • Loading branch information
DemiMarie committed Apr 23, 2024
1 parent a0e7438 commit 652b8f5
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions qrexec/tests/socket/agent.py
Original file line number Diff line number Diff line change
Expand Up @@ -938,10 +938,10 @@ def test_service_close_stdout_stderr_early(self):
#!/bin/sh
read
echo closing stdout
exec >&-
exec >/dev/null
read
echo closing stderr >&2
exec 2>&-
exec 2>/dev/null
read code
exit $code
""",
Expand Down Expand Up @@ -1028,7 +1028,7 @@ def test_close_stdin_early(self):
target, dom0 = self.execute(
"""
read
exec <&-
exec </dev/null
echo "closed stdin"
sleep 1
"""
Expand Down

0 comments on commit 652b8f5

Please sign in to comment.