nghttpx: Handle return value of write(2)
This commit is contained in:
parent
9aee518352
commit
20edd64301
|
@ -85,7 +85,8 @@ int exec_read_command(Process &proc, char *const argv[]) {
|
||||||
rv = shrpx_signal_unblock_all();
|
rv = shrpx_signal_unblock_all();
|
||||||
if (rv != 0) {
|
if (rv != 0) {
|
||||||
constexpr char msg[] = "Unblocking all signals failed\n";
|
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);
|
nghttp2_Exit(EXIT_FAILURE);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -95,7 +96,8 @@ int exec_read_command(Process &proc, char *const argv[]) {
|
||||||
rv = execv(argv[0], argv);
|
rv = execv(argv[0], argv);
|
||||||
if (rv == -1) {
|
if (rv == -1) {
|
||||||
constexpr char msg[] = "Could not execute command\n";
|
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);
|
nghttp2_Exit(EXIT_FAILURE);
|
||||||
}
|
}
|
||||||
// unreachable
|
// unreachable
|
||||||
|
|
Loading…
Reference in New Issue