diff --git a/src/shrpx_http3_upstream.cc b/src/shrpx_http3_upstream.cc index 92a8aad6..adc71a7d 100644 --- a/src/shrpx_http3_upstream.cc +++ b/src/shrpx_http3_upstream.cc @@ -136,13 +136,14 @@ void log_printf(void *user_data, const char *fmt, ...) { auto nwrite = vsnprintf(buf.data(), buf.size(), fmt, ap); va_end(ap); - if (nwrite >= buf.size()) { + if (static_cast(nwrite) >= buf.size()) { nwrite = buf.size() - 1; } buf[nwrite++] = '\n'; - write(fileno(stderr), buf.data(), nwrite); + while (write(fileno(stderr), buf.data(), nwrite) == -1 && errno == EINTR) + ; } } // namespace