From: Pierre Ossman Date: Mon, 18 May 2020 17:41:40 +0000 (+0200) Subject: Use proper constants for socket shutdown() X-Git-Tag: v1.11.90~74^2~22 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=b8973c10ab26954026e8ea4952aaec085f90b1c6;p=tigervnc.git Use proper constants for socket shutdown() For readability. --- diff --git a/common/network/Socket.cxx b/common/network/Socket.cxx index 9dd8bfe1..78484f51 100644 --- a/common/network/Socket.cxx +++ b/common/network/Socket.cxx @@ -25,6 +25,9 @@ #include #include #define errorNumber WSAGetLastError() +#define SHUT_RD SD_RECEIVE +#define SHUT_WR SD_SEND +#define SHUT_RDWR SD_BOTH #else #define errorNumber errno #define closesocket close @@ -94,7 +97,7 @@ Socket::~Socket() void Socket::shutdown() { isShutdown_ = true; - ::shutdown(getFd(), 2); + ::shutdown(getFd(), SHUT_RDWR); } bool Socket::isShutdown() const @@ -149,7 +152,7 @@ void SocketListener::shutdown() closesocket(fd); fd = -1; #else - ::shutdown(fd, 2); + ::shutdown(fd, SHUT_RDWR); #endif }