diff options
author | nga <nga@yandex-team.ru> | 2022-02-10 16:48:09 +0300 |
---|---|---|
committer | Daniil Cherednik <dcherednik@yandex-team.ru> | 2022-02-10 16:48:09 +0300 |
commit | c2a1af049e9deca890e9923abe64fe6c59060348 (patch) | |
tree | b222e5ac2e2e98872661c51ccceee5da0d291e13 /util/network/socket.cpp | |
parent | 1f553f46fb4f3c5eec631352cdd900a0709016af (diff) | |
download | ydb-c2a1af049e9deca890e9923abe64fe6c59060348.tar.gz |
Restoring authorship annotation for <nga@yandex-team.ru>. Commit 2 of 2.
Diffstat (limited to 'util/network/socket.cpp')
-rw-r--r-- | util/network/socket.cpp | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/util/network/socket.cpp b/util/network/socket.cpp index f3ea77929a..4f6e804346 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; |