diff --git a/fileutils.h b/fileutils.h index 621d94f3..af0cbad2 100644 --- a/fileutils.h +++ b/fileutils.h @@ -27,7 +27,7 @@ class fileutils { if (r == 0) return EOF; if (r < 0) { - if (!(errno == EAGAIN || errno == EWOULDBLOCK || errno == EINTR)) + if (errno == EAGAIN || errno == EWOULDBLOCK || errno == EINTR) continue; return r; } diff --git a/stats_server.cc b/stats_server.cc index 6949eaf4..bfd4739f 100644 --- a/stats_server.cc +++ b/stats_server.cc @@ -43,7 +43,7 @@ stats_server::serve_forever() int cfd = accept(fd, nullptr, 0); if (cfd < 0) throw system_error(errno, system_category(), "accept failed"); - thread(&stats_server::serve_client, this, fd).detach(); + thread(&stats_server::serve_client, this, cfd).detach(); } }