From 6fea4e6f4f6f01daf890eea75ddbe1f855f1257a Mon Sep 17 00:00:00 2001 From: Tim Kourt Date: Tue, 22 Oct 2019 16:13:17 -0700 Subject: [PATCH] t-runner: Check for errors after opening file --- tools/test-runner.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tools/test-runner.c b/tools/test-runner.c index 398494e6..1dfdb9af 100644 --- a/tools/test-runner.c +++ b/tools/test-runner.c @@ -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);