[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:
Shafik Yaghmour 2022-01-07 11:56:57 -08:00
parent 81f8345ac4
commit 4f6d3a376c
1 changed files with 2 additions and 2 deletions

View File

@ -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;