Skip to content

Commit

Permalink
Merge pull request #1553 from giuseppe/hooks-ignore-EPIPE
Browse files Browse the repository at this point in the history
linux: ignore EPIPE for hooks
  • Loading branch information
flouthoc authored Sep 5, 2024
2 parents 00fde03 + 2c4db99 commit 4467dd9
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/libcrun/utils.c
Original file line number Diff line number Diff line change
Expand Up @@ -1671,8 +1671,13 @@ run_process_with_stdin_timeout_envp (char *path, char **args, const char *cwd, i
ret = TEMP_FAILURE_RETRY (write (pipe_w, stdin, stdin_len));
if (UNLIKELY (ret < 0))
{
ret = crun_make_error (err, errno, "writing to pipe");
goto restore_sig_mask_and_exit;
/* Ignore EPIPE as the container process could have already
been terminated. */
if (errno != EPIPE)
{
ret = crun_make_error (err, errno, "writing to pipe");
goto restore_sig_mask_and_exit;
}
}

close_and_reset (&pipe_w);
Expand Down

0 comments on commit 4467dd9

Please sign in to comment.