Commit 20edd643 authored by Tatsuhiro Tsujikawa's avatar Tatsuhiro Tsujikawa

nghttpx: Handle return value of write(2)

parent 9aee5183
......@@ -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
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment