forked from OSchip/llvm-project
[LLDB] Fix setting of success in Socket::Close()
Both close and closesocket should return 0 on success so using !! looks incorrect. I replaced this will a more readable == 0 check. Differential Revision: https://reviews.llvm.org/D116768
This commit is contained in:
parent
81f8345ac4
commit
4f6d3a376c
|
@ -281,9 +281,9 @@ Status Socket::Close() {
|
|||
static_cast<void *>(this), static_cast<uint64_t>(m_socket));
|
||||
|
||||
#if defined(_WIN32)
|
||||
bool success = !!closesocket(m_socket);
|
||||
bool success = closesocket(m_socket) == 0;
|
||||
#else
|
||||
bool success = !!::close(m_socket);
|
||||
bool success = ::close(m_socket) == 0;
|
||||
#endif
|
||||
// A reference to a FD was passed in, set it to an invalid value
|
||||
m_socket = kInvalidSocketValue;
|
||||
|
|
Loading…
Reference in New Issue