Skip to content

Commit

Permalink
Check the result of pipe().
Browse files Browse the repository at this point in the history
  • Loading branch information
ianh committed Nov 10, 2021
1 parent 2db35ea commit ed55aed
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/test.c
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,8 @@ void finish_test_compilation(struct test_compilation *t, char *input_string)
static void spawn_child(struct test_compilation *t)
{
int fd[2];
pipe(fd);
if (pipe(fd) == -1)
exit_with_errorf("pipe() failed - %s", strerror(errno));
t->child = fork();
if (t->child == -1)
exit_with_errorf("fork() failed - %s", strerror(errno));
Expand Down

0 comments on commit ed55aed

Please sign in to comment.