Merge pull request #9397 from xiexingguo/xxg-wip-fixsocketfd-leak

common/admin_socket: fix socket fd leak

Reviewed-by: Kefu Chai <kchai@redhat.com>
This commit is contained in:
Sage Weil 2016-06-15 15:04:26 -04:00 committed by GitHub
commit 2fd1390f48

View File

@ -322,7 +322,7 @@ bool AdminSocket::do_accept()
if (ret <= 0) {
lderr(m_cct) << "AdminSocket: error reading request code: "
<< cpp_strerror(ret) << dendl;
close(connection_fd);
VOID_TEMP_FAILURE_RETRY(close(connection_fd));
return false;
}
//ldout(m_cct, 0) << "AdminSocket read byte " << (int)cmd[pos] << " pos " << pos << dendl;
@ -365,6 +365,7 @@ bool AdminSocket::do_accept()
cmdvec.push_back(cmd);
if (!cmdmap_from_json(cmdvec, &cmdmap, errss)) {
ldout(m_cct, 0) << "AdminSocket: " << errss.rdbuf() << dendl;
VOID_TEMP_FAILURE_RETRY(close(connection_fd));
return false;
}
cmd_getval(m_cct, cmdmap, "format", format);