t-runner: Check for errors after opening file

This commit is contained in:
Tim Kourt 2019-10-22 16:13:17 -07:00 committed by Denis Kenzior
parent e3551ab56b
commit 6fea4e6f4f
1 changed files with 3 additions and 0 deletions

View File

@ -524,6 +524,9 @@ static pid_t execute_program(char *argv[], char *envp[], bool wait,
S_IRUSR | S_IWUSR);
}
if (fd == -1)
exit(EXIT_FAILURE);
dup2(fd, 1);
dup2(fd, 2);