diff options
author | phud <phud@yandex-team.ru> | 2022-02-10 16:51:45 +0300 |
---|---|---|
committer | Daniil Cherednik <dcherednik@yandex-team.ru> | 2022-02-10 16:51:45 +0300 |
commit | d96d43aa41d3bdd060cd182ca9c472e667bfcf2c (patch) | |
tree | ab7fbbf3253d4c0e2793218f09378908beb025fb | |
parent | 0a405889878cba55d4d7cf8b5256bacc364bee9c (diff) | |
download | ydb-d96d43aa41d3bdd060cd182ca9c472e667bfcf2c.tar.gz |
Restoring authorship annotation for <phud@yandex-team.ru>. Commit 2 of 2.
-rw-r--r-- | util/system/daemon.cpp | 4 | ||||
-rw-r--r-- | util/system/info.cpp | 20 | ||||
-rw-r--r-- | util/system/info.h | 2 | ||||
-rw-r--r-- | util/system/shellcommand.cpp | 4 |
4 files changed, 15 insertions, 15 deletions
diff --git a/util/system/daemon.cpp b/util/system/daemon.cpp index 00838f349b..130e6c8f45 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 9504fa1431..cf6681e89a 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 b7f87ab7c9..73ebe48a9a 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 953bb134d1..b1989b5c8c 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); } } |