mirror of
https://github.com/SerenityOS/serenity.git
synced 2025-01-23 09:51:57 -05:00
test-test262: Close the output file stream after writing
Without this the runner is waiting for new tests which will never come and test-test262 is waiting for output which never comes since the runner is blocked. Also finish off a comment, and make the variables follow serenity style.
This commit is contained in:
parent
d9360676cd
commit
49e3b387ac
1 changed files with 10 additions and 7 deletions
|
@ -161,12 +161,12 @@ public:
|
||||||
bool write_lines(Span<String> lines)
|
bool write_lines(Span<String> lines)
|
||||||
{
|
{
|
||||||
// It's possible the process dies before we can write all the tests
|
// It's possible the process dies before we can write all the tests
|
||||||
// to the stdin. So make sure that
|
// to the stdin. So make sure that we don't crash but just stop writing.
|
||||||
struct sigaction act { };
|
struct sigaction action_handler { };
|
||||||
struct sigaction oldAct;
|
struct sigaction old_action_handler;
|
||||||
act.sa_flags = 0;
|
action_handler.sa_flags = 0;
|
||||||
act.sa_handler = SIG_IGN;
|
action_handler.sa_handler = SIG_IGN;
|
||||||
if (sigaction(SIGPIPE, &act, &oldAct) < 0) {
|
if (sigaction(SIGPIPE, &action_handler, &old_action_handler) < 0) {
|
||||||
perror("sigaction");
|
perror("sigaction");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@ -176,8 +176,11 @@ public:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Ensure that the input stream ends here, whether we were able to write all lines or not
|
||||||
|
m_output->close();
|
||||||
|
|
||||||
// It's not really a problem if this signal failed
|
// It's not really a problem if this signal failed
|
||||||
if (sigaction(SIGPIPE, &oldAct, nullptr) < 0)
|
if (sigaction(SIGPIPE, &old_action_handler, nullptr) < 0)
|
||||||
perror("sigaction");
|
perror("sigaction");
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
|
Loading…
Add table
Reference in a new issue