From a0b08159adceda92bbc6344a8298361ff3825d06 Mon Sep 17 00:00:00 2001 From: "Matthias P. Braendli" Date: Mon, 18 Nov 2019 11:34:04 +0100 Subject: Apply common 23752f6 and e10272e --- lib/Socket.cpp | 2 +- lib/Socket.h | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/Socket.cpp b/lib/Socket.cpp index 50a12ba..bfbef93 100644 --- a/lib/Socket.cpp +++ b/lib/Socket.cpp @@ -650,7 +650,7 @@ ssize_t TCPSocket::recv(void *buffer, size_t length, int flags, int timeout_ms) std::string errstr(strerror(errno)); throw std::runtime_error("TCP receive with poll() error: " + errstr); } - else if (retval > 0 and (fds[0].revents | POLLIN)) { + else if (retval > 0 and (fds[0].revents & POLLIN)) { ssize_t ret = ::recv(m_sock, buffer, length, flags); if (ret == -1) { if (errno == ECONNREFUSED) { diff --git a/lib/Socket.h b/lib/Socket.h index df80b08..b9f6317 100644 --- a/lib/Socket.h +++ b/lib/Socket.h @@ -258,7 +258,7 @@ class TCPDataDispatcher size_t m_max_queue_size; - std::atomic m_running; + std::atomic m_running = ATOMIC_VAR_INIT(false); std::string m_exception_data; std::thread m_listener_thread; TCPSocket m_listener_socket; @@ -285,7 +285,7 @@ class TCPReceiveServer { size_t m_blocksize = 0; ThreadsafeQueue > m_queue; - std::atomic m_running; + std::atomic m_running = ATOMIC_VAR_INIT(false); std::string m_exception_data; std::thread m_listener_thread; TCPSocket m_listener_socket; -- cgit v1.2.3