nghttpx: Fix CI build error

This commit is contained in:
Tatsuhiro Tsujikawa 2021-08-22 22:17:19 +09:00
parent 0dcdf7ae21
commit 6f243108e9
1 changed files with 3 additions and 2 deletions

View File

@ -136,13 +136,14 @@ void log_printf(void *user_data, const char *fmt, ...) {
auto nwrite = vsnprintf(buf.data(), buf.size(), fmt, ap); auto nwrite = vsnprintf(buf.data(), buf.size(), fmt, ap);
va_end(ap); va_end(ap);
if (nwrite >= buf.size()) { if (static_cast<size_t>(nwrite) >= buf.size()) {
nwrite = buf.size() - 1; nwrite = buf.size() - 1;
} }
buf[nwrite++] = '\n'; buf[nwrite++] = '\n';
write(fileno(stderr), buf.data(), nwrite); while (write(fileno(stderr), buf.data(), nwrite) == -1 && errno == EINTR)
;
} }
} // namespace } // namespace