h2load: Fix compile error with gcc

This commit is contained in:
Tatsuhiro Tsujikawa 2018-11-23 14:39:51 +09:00
parent 089a03be42
commit 302abf1b46
1 changed files with 4 additions and 2 deletions

View File

@ -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<size_t>(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)
;
}
}