From 302abf1b46ec24b7db52f2f5ccc52c29dcc48556 Mon Sep 17 00:00:00 2001 From: Tatsuhiro Tsujikawa Date: Fri, 23 Nov 2018 14:39:51 +0900 Subject: [PATCH] h2load: Fix compile error with gcc --- src/h2load.cc | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/h2load.cc b/src/h2load.cc index 8669a719..a0b5166c 100644 --- a/src/h2load.cc +++ b/src/h2load.cc @@ -845,9 +845,11 @@ void Client::on_stream_close(int32_t stream_id, bool success, bool final) { p = util::utos(p, delta.count()); *p++ = '\n'; - auto nwrite = std::distance(std::begin(buf), p); + auto nwrite = static_cast(std::distance(std::begin(buf), p)); assert(nwrite <= buf.size()); - write(worker->config->log_fd, buf.data(), nwrite); + while (write(worker->config->log_fd, buf.data(), nwrite) == -1 && + errno == EINTR) + ; } }