summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordefencer <[email protected]>2022-02-10 16:52:01 +0300
committerDaniil Cherednik <[email protected]>2022-02-10 16:52:01 +0300
commitbab6bea2cd46463bec931057fae2181f02d211d2 (patch)
treeab7fbbf3253d4c0e2793218f09378908beb025fb
parentb42710018bef676796d30f8e874d4604b062e57d (diff)
Restoring authorship annotation for <[email protected]>. Commit 2 of 2.
-rw-r--r--util/network/socket.cpp36
-rw-r--r--util/network/socket.h2
2 files changed, 19 insertions, 19 deletions
diff --git a/util/network/socket.cpp b/util/network/socket.cpp
index 03063bec787..4f6e8043462 100644
--- a/util/network/socket.cpp
+++ b/util/network/socket.cpp
@@ -325,26 +325,26 @@ void SetNoDelay(SOCKET s, bool value) {
CheckedSetSockOpt(s, IPPROTO_TCP, TCP_NODELAY, (int)value, "tcp no delay");
}
-void SetCloseOnExec(SOCKET s, bool value) {
-#if defined(_unix_)
- int flags = fcntl(s, F_GETFD);
- if (flags == -1) {
- ythrow TSystemError() << "fcntl() failed";
- }
- if (value) {
- flags |= FD_CLOEXEC;
- } else {
- flags &= ~FD_CLOEXEC;
- }
- if (fcntl(s, F_SETFD, flags) == -1) {
- ythrow TSystemError() << "fcntl() failed";
- }
-#else
+void SetCloseOnExec(SOCKET s, bool value) {
+#if defined(_unix_)
+ int flags = fcntl(s, F_GETFD);
+ if (flags == -1) {
+ ythrow TSystemError() << "fcntl() failed";
+ }
+ if (value) {
+ flags |= FD_CLOEXEC;
+ } else {
+ flags &= ~FD_CLOEXEC;
+ }
+ if (fcntl(s, F_SETFD, flags) == -1) {
+ ythrow TSystemError() << "fcntl() failed";
+ }
+#else
Y_UNUSED(s);
Y_UNUSED(value);
-#endif
-}
-
+#endif
+}
+
size_t GetMaximumSegmentSize(SOCKET s) {
#if defined(TCP_MAXSEG)
int val;
diff --git a/util/network/socket.h b/util/network/socket.h
index 5fe24d1deb0..40c8648b409 100644
--- a/util/network/socket.h
+++ b/util/network/socket.h
@@ -103,7 +103,7 @@ void SetKeepAlive(SOCKET s);
void SetLinger(SOCKET s, bool on, unsigned len);
void SetZeroLinger(SOCKET s);
void SetKeepAlive(SOCKET s, bool value);
-void SetCloseOnExec(SOCKET s, bool value);
+void SetCloseOnExec(SOCKET s, bool value);
void SetOutputBuffer(SOCKET s, unsigned value);
void SetInputBuffer(SOCKET s, unsigned value);
void SetReusePort(SOCKET s, bool value);