From: Patrick Donnelly Date: Wed, 11 Dec 2019 20:06:14 +0000 (-0800) Subject: common: handle return value from read(2) X-Git-Tag: v15.1.0~502^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F32192%2Fhead;p=ceph.git common: handle return value from read(2) Fixes: https://tracker.ceph.com/issues/43266 Signed-off-by: Patrick Donnelly --- diff --git a/src/common/admin_socket.cc b/src/common/admin_socket.cc index 6ef57ecf644..4a21311ad10 100644 --- a/src/common/admin_socket.cc +++ b/src/common/admin_socket.cc @@ -256,7 +256,12 @@ void AdminSocket::entry() noexcept if (fds[1].revents & POLLIN) { // read off one byte char buf; - ::read(m_wakeup_rd_fd, &buf, 1); + auto s = ::read(m_wakeup_rd_fd, &buf, 1); + if (s == -1) { + int e = errno; + ldout(m_cct, 5) << "AdminSocket: (ignoring) read(2) error: '" + << cpp_strerror(e) << dendl; + } do_tell_queue(); } if (m_shutdown) {