diff --git a/src/shrpx_exec.cc b/src/shrpx_exec.cc index 09864dd8..efff4d68 100644 --- a/src/shrpx_exec.cc +++ b/src/shrpx_exec.cc @@ -85,7 +85,8 @@ int exec_read_command(Process &proc, char *const argv[]) { rv = shrpx_signal_unblock_all(); if (rv != 0) { constexpr char msg[] = "Unblocking all signals failed\n"; - write(STDERR_FILENO, msg, str_size(msg)); + while (write(STDERR_FILENO, msg, str_size(msg)) == -1 && errno == EINTR) + ; nghttp2_Exit(EXIT_FAILURE); } @@ -95,7 +96,8 @@ int exec_read_command(Process &proc, char *const argv[]) { rv = execv(argv[0], argv); if (rv == -1) { constexpr char msg[] = "Could not execute command\n"; - write(STDERR_FILENO, msg, str_size(msg)); + while (write(STDERR_FILENO, msg, str_size(msg)) == -1 && errno == EINTR) + ; nghttp2_Exit(EXIT_FAILURE); } // unreachable