aboutsummaryrefslogtreecommitdiffstats
path: root/util/network/socket.cpp
diff options
context:
space:
mode:
authornga <nga@yandex-team.ru>2022-02-10 16:48:09 +0300
committerDaniil Cherednik <dcherednik@yandex-team.ru>2022-02-10 16:48:09 +0300
commit1f553f46fb4f3c5eec631352cdd900a0709016af (patch)
treea231fba2c03b440becaea6c86a2702d0bfb0336e /util/network/socket.cpp
parentc4de7efdedc25b49cbea74bd589eecb61b55b60a (diff)
downloadydb-1f553f46fb4f3c5eec631352cdd900a0709016af.tar.gz
Restoring authorship annotation for <nga@yandex-team.ru>. Commit 1 of 2.
Diffstat (limited to 'util/network/socket.cpp')
-rw-r--r--util/network/socket.cpp26
1 files changed, 13 insertions, 13 deletions
diff --git a/util/network/socket.cpp b/util/network/socket.cpp
index 4f6e804346..f3ea77929a 100644
--- a/util/network/socket.cpp
+++ b/util/network/socket.cpp
@@ -554,25 +554,25 @@ static ssize_t DoSendMsg(SOCKET sock, const struct iovec* iov, int iovcnt) {
#endif
void TSocketHolder::Close() noexcept {
- if (Fd_ != INVALID_SOCKET) {
- bool ok = (closesocket(Fd_) == 0);
- if (!ok) {
+ if (Fd_ != INVALID_SOCKET) {
+ bool ok = (closesocket(Fd_) == 0);
+ if (!ok) {
// Do not quietly close bad descriptor,
// because often it means double close
// that is disasterous
-#ifdef _win_
+#ifdef _win_
Y_VERIFY(WSAGetLastError() != WSAENOTSOCK, "must not quietly close bad socket descriptor");
-#elif defined(_unix_)
+#elif defined(_unix_)
Y_VERIFY(errno != EBADF, "must not quietly close bad descriptor: fd=%d", int(Fd_));
-#else
+#else
#error unsupported platform
-#endif
- }
-
- Fd_ = INVALID_SOCKET;
- }
-}
-
+#endif
+ }
+
+ Fd_ = INVALID_SOCKET;
+ }
+}
+
class TSocket::TImpl: public TAtomicRefCount<TImpl> {
using TOps = TSocket::TOps;