aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorphud <phud@yandex-team.ru>2022-02-10 16:51:45 +0300
committerDaniil Cherednik <dcherednik@yandex-team.ru>2022-02-10 16:51:45 +0300
commit0a405889878cba55d4d7cf8b5256bacc364bee9c (patch)
tree6e7ad7c31ab02168047caf3b04dcb6ee36ee00a5
parentdd80ec62c76c5c848197b5b7468e6e215e59d715 (diff)
downloadydb-0a405889878cba55d4d7cf8b5256bacc364bee9c.tar.gz
Restoring authorship annotation for <phud@yandex-team.ru>. Commit 1 of 2.
-rw-r--r--util/system/daemon.cpp4
-rw-r--r--util/system/info.cpp20
-rw-r--r--util/system/info.h2
-rw-r--r--util/system/shellcommand.cpp4
4 files changed, 15 insertions, 15 deletions
diff --git a/util/system/daemon.cpp b/util/system/daemon.cpp
index 130e6c8f45..00838f349b 100644
--- a/util/system/daemon.cpp
+++ b/util/system/daemon.cpp
@@ -2,7 +2,7 @@
#include <cerrno>
#include <cstdlib>
-#include <util/system/info.h>
+#include <util/system/info.h>
#if defined(_win_)
#include <io.h>
@@ -55,7 +55,7 @@ static void CloseFromToExcept(int from, int to, const int* except) {
(void)except;
#ifdef _unix_
- int mfd = NSystemInfo::MaxOpenFiles();
+ int mfd = NSystemInfo::MaxOpenFiles();
for (int s = from; s < mfd && (to == -1 || s < to); s++) {
for (const int* ex = except; *ex >= 0; ++ex) {
if (s == *ex) {
diff --git a/util/system/info.cpp b/util/system/info.cpp
index cf6681e89a..9504fa1431 100644
--- a/util/system/info.cpp
+++ b/util/system/info.cpp
@@ -227,13 +227,13 @@ size_t NSystemInfo::TotalMemorySize() {
return 0;
#endif
}
-
-size_t NSystemInfo::MaxOpenFiles() {
-#if defined(ANDROID) || defined(__ANDROID__)
- return sysconf(_SC_OPEN_MAX);
-#elif defined(_win_)
- return _getmaxstdio();
-#else
- return getdtablesize();
-#endif
-}
+
+size_t NSystemInfo::MaxOpenFiles() {
+#if defined(ANDROID) || defined(__ANDROID__)
+ return sysconf(_SC_OPEN_MAX);
+#elif defined(_win_)
+ return _getmaxstdio();
+#else
+ return getdtablesize();
+#endif
+}
diff --git a/util/system/info.h b/util/system/info.h
index 73ebe48a9a..b7f87ab7c9 100644
--- a/util/system/info.h
+++ b/util/system/info.h
@@ -8,5 +8,5 @@ namespace NSystemInfo {
size_t LoadAverage(double* la, size_t len);
size_t GetPageSize() noexcept;
size_t TotalMemorySize();
- size_t MaxOpenFiles();
+ size_t MaxOpenFiles();
}
diff --git a/util/system/shellcommand.cpp b/util/system/shellcommand.cpp
index b1989b5c8c..953bb134d1 100644
--- a/util/system/shellcommand.cpp
+++ b/util/system/shellcommand.cpp
@@ -14,7 +14,7 @@
#include <util/stream/pipe.h>
#include <util/stream/str.h>
#include <util/string/cast.h>
-#include <util/system/info.h>
+#include <util/system/info.h>
#include <errno.h>
@@ -721,7 +721,7 @@ void TShellCommand::TImpl::OnFork(TPipes& pipes, sigset_t oldmask, char* const*
}
if (CloseAllFdsOnExec) {
- for (int fd = NSystemInfo::MaxOpenFiles(); fd > STDERR_FILENO; --fd) {
+ for (int fd = NSystemInfo::MaxOpenFiles(); fd > STDERR_FILENO; --fd) {
fcntl(fd, F_SETFD, FD_CLOEXEC);
}
}