aboutsummaryrefslogtreecommitdiffstats
path: root/util
diff options
context:
space:
mode:
authorsnowball <snowball@yandex-team.ru>2022-02-10 16:46:32 +0300
committerDaniil Cherednik <dcherednik@yandex-team.ru>2022-02-10 16:46:32 +0300
commit4d57126b1bae3cfd0f4f95c32d1a85ca684ee92c (patch)
tree9aa76172d0e8abdf7c78fce6ec639c5d7e62b459 /util
parent249e91c445cb92462f9509d1ef2730b27629f43d (diff)
downloadydb-4d57126b1bae3cfd0f4f95c32d1a85ca684ee92c.tar.gz
Restoring authorship annotation for <snowball@yandex-team.ru>. Commit 1 of 2.
Diffstat (limited to 'util')
-rw-r--r--util/charset/benchmark/to_lower/metrics/ya.make2
-rw-r--r--util/charset/benchmark/utf8_to_wide/metrics/ya.make2
-rw-r--r--util/charset/ya.make2
-rw-r--r--util/draft/ya.make2
-rw-r--r--util/folder/path.h6
-rw-r--r--util/folder/path_ut.cpp4
-rw-r--r--util/generic/benchmark/fastclp2/metrics/ya.make2
-rw-r--r--util/generic/benchmark/log2/metrics/ya.make2
-rw-r--r--util/generic/benchmark/rotate_bits/metrics/ya.make2
-rw-r--r--util/generic/benchmark/vector_count_ctor/metrics/ya.make2
-rw-r--r--util/generic/hash.h8
-rw-r--r--util/memory/benchmark/pool/metrics/ya.make2
-rw-r--r--util/network/ut/ya.make4
-rw-r--r--util/random/benchmark/prng/metrics/ya.make2
-rw-r--r--util/string/benchmark/float_to_string/metrics/ya.make2
-rw-r--r--util/string/benchmark/join/metrics/ya.make2
-rw-r--r--util/string/benchmark/subst_global/metrics/ya.make2
-rw-r--r--util/system/benchmark/cpu_id/metrics/ya.make2
-rw-r--r--util/system/benchmark/create_destroy_thread/metrics/ya.make2
-rw-r--r--util/system/fstat.cpp10
-rw-r--r--util/system/shellcommand.cpp46
-rw-r--r--util/system/shellcommand.h32
-rw-r--r--util/ya.make12
23 files changed, 76 insertions, 76 deletions
diff --git a/util/charset/benchmark/to_lower/metrics/ya.make b/util/charset/benchmark/to_lower/metrics/ya.make
index 5bb3461a8d..d5ef20a534 100644
--- a/util/charset/benchmark/to_lower/metrics/ya.make
+++ b/util/charset/benchmark/to_lower/metrics/ya.make
@@ -9,7 +9,7 @@ PY2TEST()
SIZE(LARGE)
TAG(
- ya:force_sandbox
+ ya:force_sandbox
sb:intel_e5_2660v1
ya:fat
)
diff --git a/util/charset/benchmark/utf8_to_wide/metrics/ya.make b/util/charset/benchmark/utf8_to_wide/metrics/ya.make
index c406e25bee..561a9d7908 100644
--- a/util/charset/benchmark/utf8_to_wide/metrics/ya.make
+++ b/util/charset/benchmark/utf8_to_wide/metrics/ya.make
@@ -9,7 +9,7 @@ PY2TEST()
SIZE(LARGE)
TAG(
- ya:force_sandbox
+ ya:force_sandbox
sb:intel_e5_2660v1
ya:fat
)
diff --git a/util/charset/ya.make b/util/charset/ya.make
index 26d38cb10b..466c045ce8 100644
--- a/util/charset/ya.make
+++ b/util/charset/ya.make
@@ -3,7 +3,7 @@ LIBRARY()
OWNER(g:util)
SUBSCRIBER(g:util-subscribers)
-NO_UTIL()
+NO_UTIL()
IF (TSTRING_IS_STD_STRING)
CFLAGS(GLOBAL -DTSTRING_IS_STD_STRING)
diff --git a/util/draft/ya.make b/util/draft/ya.make
index e00674b682..95054f15c8 100644
--- a/util/draft/ya.make
+++ b/util/draft/ya.make
@@ -3,7 +3,7 @@ LIBRARY()
OWNER(g:util)
SUBSCRIBER(g:util-subscribers)
-NO_UTIL()
+NO_UTIL()
IF (TSTRING_IS_STD_STRING)
CFLAGS(GLOBAL -DTSTRING_IS_STD_STRING)
diff --git a/util/folder/path.h b/util/folder/path.h
index 2fb4d6b4ef..1ddcacd55a 100644
--- a/util/folder/path.h
+++ b/util/folder/path.h
@@ -56,9 +56,9 @@ public:
return Path_ == that.Path_;
}
- inline bool operator!=(const TFsPath& that) const {
- return Path_ != that.Path_;
- }
+ inline bool operator!=(const TFsPath& that) const {
+ return Path_ != that.Path_;
+ }
TFsPath& operator/=(const TFsPath& that);
diff --git a/util/folder/path_ut.cpp b/util/folder/path_ut.cpp
index e6a3451016..f640a92365 100644
--- a/util/folder/path_ut.cpp
+++ b/util/folder/path_ut.cpp
@@ -400,14 +400,14 @@ Y_UNIT_TEST_SUITE(TFsPathTests) {
UNIT_ASSERT_VALUES_EQUAL(JoinFsPaths("a\\b\\..\\c", "d"), "a\\c\\d");
UNIT_ASSERT_VALUES_EQUAL(JoinFsPaths("a", "b", "c", "d"), "a\\b\\c\\d");
UNIT_ASSERT_VALUES_EQUAL(JoinFsPaths("a\\b\\..\\c"), "a\\b\\..\\c");
- UNIT_ASSERT_VALUES_EQUAL(JoinFsPaths("a\\b", ""), "a\\b");
+ UNIT_ASSERT_VALUES_EQUAL(JoinFsPaths("a\\b", ""), "a\\b");
#else
UNIT_ASSERT_VALUES_EQUAL(JoinFsPaths("a/b", "c/d"), "a/b/c/d");
UNIT_ASSERT_VALUES_EQUAL(JoinFsPaths("a/b", "../c"), "a/b/../c");
UNIT_ASSERT_VALUES_EQUAL(JoinFsPaths("a/b/../c", "d"), "a/c/d");
UNIT_ASSERT_VALUES_EQUAL(JoinFsPaths("a", "b", "c", "d"), "a/b/c/d");
UNIT_ASSERT_VALUES_EQUAL(JoinFsPaths("a/b/../c"), "a/b/../c");
- UNIT_ASSERT_VALUES_EQUAL(JoinFsPaths("a/b", ""), "a/b");
+ UNIT_ASSERT_VALUES_EQUAL(JoinFsPaths("a/b", ""), "a/b");
#endif
}
diff --git a/util/generic/benchmark/fastclp2/metrics/ya.make b/util/generic/benchmark/fastclp2/metrics/ya.make
index b2d17ebad3..63805b3322 100644
--- a/util/generic/benchmark/fastclp2/metrics/ya.make
+++ b/util/generic/benchmark/fastclp2/metrics/ya.make
@@ -9,7 +9,7 @@ PY2TEST()
SIZE(LARGE)
TAG(
- ya:force_sandbox
+ ya:force_sandbox
sb:intel_e5_2660v1
ya:fat
)
diff --git a/util/generic/benchmark/log2/metrics/ya.make b/util/generic/benchmark/log2/metrics/ya.make
index eb987e38d2..8882caa144 100644
--- a/util/generic/benchmark/log2/metrics/ya.make
+++ b/util/generic/benchmark/log2/metrics/ya.make
@@ -9,7 +9,7 @@ PY2TEST()
SIZE(LARGE)
TAG(
- ya:force_sandbox
+ ya:force_sandbox
sb:intel_e5_2660v1
ya:fat
)
diff --git a/util/generic/benchmark/rotate_bits/metrics/ya.make b/util/generic/benchmark/rotate_bits/metrics/ya.make
index ac27d2f845..91155cca68 100644
--- a/util/generic/benchmark/rotate_bits/metrics/ya.make
+++ b/util/generic/benchmark/rotate_bits/metrics/ya.make
@@ -9,7 +9,7 @@ PY2TEST()
SIZE(LARGE)
TAG(
- ya:force_sandbox
+ ya:force_sandbox
sb:intel_e5_2660v1
ya:fat
)
diff --git a/util/generic/benchmark/vector_count_ctor/metrics/ya.make b/util/generic/benchmark/vector_count_ctor/metrics/ya.make
index c48f89b564..f9e9ed60a0 100644
--- a/util/generic/benchmark/vector_count_ctor/metrics/ya.make
+++ b/util/generic/benchmark/vector_count_ctor/metrics/ya.make
@@ -9,7 +9,7 @@ PY2TEST()
SIZE(LARGE)
TAG(
- ya:force_sandbox
+ ya:force_sandbox
sb:intel_e5_2660v1
ya:fat
)
diff --git a/util/generic/hash.h b/util/generic/hash.h
index e46db21fa9..47bbf11544 100644
--- a/util/generic/hash.h
+++ b/util/generic/hash.h
@@ -48,10 +48,10 @@ template <class Value, class Key, class HashFcn,
class ExtractKey, class EqualKey, class Alloc>
class THashTable;
-template <class Key, class T, class HashFcn,
- class EqualKey, typename size_type_f>
-class sthash;
-
+template <class Key, class T, class HashFcn,
+ class EqualKey, typename size_type_f>
+class sthash;
+
template <class Value>
struct __yhashtable_iterator;
diff --git a/util/memory/benchmark/pool/metrics/ya.make b/util/memory/benchmark/pool/metrics/ya.make
index c671bc5c1c..dbc6f1cae3 100644
--- a/util/memory/benchmark/pool/metrics/ya.make
+++ b/util/memory/benchmark/pool/metrics/ya.make
@@ -6,7 +6,7 @@ PY2TEST()
SIZE(LARGE)
TAG(
- ya:force_sandbox
+ ya:force_sandbox
sb:intel_e5_2660v1
ya:fat
)
diff --git a/util/network/ut/ya.make b/util/network/ut/ya.make
index 1ba03e167c..0814bc2b4f 100644
--- a/util/network/ut/ya.make
+++ b/util/network/ut/ya.make
@@ -1,7 +1,7 @@
UNITTEST_FOR(util)
-REQUIREMENTS(network:full)
-
+REQUIREMENTS(network:full)
+
OWNER(g:util)
SUBSCRIBER(g:util-subscribers)
diff --git a/util/random/benchmark/prng/metrics/ya.make b/util/random/benchmark/prng/metrics/ya.make
index 1f56aac0bd..8ff7a53419 100644
--- a/util/random/benchmark/prng/metrics/ya.make
+++ b/util/random/benchmark/prng/metrics/ya.make
@@ -9,7 +9,7 @@ PY2TEST()
SIZE(LARGE)
TAG(
- ya:force_sandbox
+ ya:force_sandbox
sb:intel_e5_2660v1
ya:fat
)
diff --git a/util/string/benchmark/float_to_string/metrics/ya.make b/util/string/benchmark/float_to_string/metrics/ya.make
index 4b8c4cc07d..46791a6b93 100644
--- a/util/string/benchmark/float_to_string/metrics/ya.make
+++ b/util/string/benchmark/float_to_string/metrics/ya.make
@@ -9,7 +9,7 @@ PY2TEST()
SIZE(LARGE)
TAG(
- ya:force_sandbox
+ ya:force_sandbox
sb:intel_e5_2660v1
ya:fat
)
diff --git a/util/string/benchmark/join/metrics/ya.make b/util/string/benchmark/join/metrics/ya.make
index 08ff3a149f..c30e133e18 100644
--- a/util/string/benchmark/join/metrics/ya.make
+++ b/util/string/benchmark/join/metrics/ya.make
@@ -9,7 +9,7 @@ PY2TEST()
SIZE(LARGE)
TAG(
- ya:force_sandbox
+ ya:force_sandbox
sb:intel_e5_2660v1
ya:fat
)
diff --git a/util/string/benchmark/subst_global/metrics/ya.make b/util/string/benchmark/subst_global/metrics/ya.make
index d8c30ad460..15e1edb7b8 100644
--- a/util/string/benchmark/subst_global/metrics/ya.make
+++ b/util/string/benchmark/subst_global/metrics/ya.make
@@ -9,7 +9,7 @@ PY2TEST()
SIZE(LARGE)
TAG(
- ya:force_sandbox
+ ya:force_sandbox
sb:intel_e5_2660v1
ya:fat
)
diff --git a/util/system/benchmark/cpu_id/metrics/ya.make b/util/system/benchmark/cpu_id/metrics/ya.make
index 8c55def99b..b15a3230a0 100644
--- a/util/system/benchmark/cpu_id/metrics/ya.make
+++ b/util/system/benchmark/cpu_id/metrics/ya.make
@@ -9,7 +9,7 @@ PY2TEST()
SIZE(LARGE)
TAG(
- ya:force_sandbox
+ ya:force_sandbox
sb:intel_e5_2660v1
ya:fat
)
diff --git a/util/system/benchmark/create_destroy_thread/metrics/ya.make b/util/system/benchmark/create_destroy_thread/metrics/ya.make
index d526487e1a..92a8b5752f 100644
--- a/util/system/benchmark/create_destroy_thread/metrics/ya.make
+++ b/util/system/benchmark/create_destroy_thread/metrics/ya.make
@@ -9,7 +9,7 @@ PY2TEST()
SIZE(LARGE)
TAG(
- ya:force_sandbox
+ ya:force_sandbox
sb:intel_e5_2660v1
ya:fat
)
diff --git a/util/system/fstat.cpp b/util/system/fstat.cpp
index 81e98cbc6b..ea87835fc7 100644
--- a/util/system/fstat.cpp
+++ b/util/system/fstat.cpp
@@ -15,7 +15,7 @@
#endif
#define _S_IFLNK 0x80000000
-ui32 GetFileMode(DWORD fileAttributes) {
+ui32 GetFileMode(DWORD fileAttributes) {
ui32 mode = 0;
if (fileAttributes == 0xFFFFFFFF)
return mode;
@@ -23,14 +23,14 @@ ui32 GetFileMode(DWORD fileAttributes) {
mode |= _S_IFCHR;
if (fileAttributes & FILE_ATTRIBUTE_REPARSE_POINT)
mode |= _S_IFLNK; // todo: was undefined by the moment of writing this code
- if (fileAttributes & FILE_ATTRIBUTE_DIRECTORY)
+ if (fileAttributes & FILE_ATTRIBUTE_DIRECTORY)
mode |= _S_IFDIR;
if (fileAttributes & (FILE_ATTRIBUTE_NORMAL | FILE_ATTRIBUTE_ARCHIVE))
mode |= _S_IFREG;
if ((fileAttributes & FILE_ATTRIBUTE_READONLY) == 0)
mode |= _S_IWRITE;
return mode;
-}
+}
#define S_ISDIR(st_mode) (st_mode & _S_IFDIR)
#define S_ISREG(st_mode) (st_mode & _S_IFREG)
@@ -42,8 +42,8 @@ using TSystemFStat = BY_HANDLE_FILE_INFORMATION;
using TSystemFStat = struct stat;
-#endif
-
+#endif
+
static void MakeStat(TFileStat& st, const TSystemFStat& fs) {
#ifdef _unix_
st.Mode = fs.st_mode;
diff --git a/util/system/shellcommand.cpp b/util/system/shellcommand.cpp
index b1989b5c8c..d071d8a4b3 100644
--- a/util/system/shellcommand.cpp
+++ b/util/system/shellcommand.cpp
@@ -28,11 +28,11 @@ using TPid = pid_t;
using TWaitResult = pid_t;
using TExitStatus = int;
#define WAIT_PROCEED 0
-
+
#if defined(_darwin_)
-using TGetGroupListGid = int;
+using TGetGroupListGid = int;
#else
-using TGetGroupListGid = gid_t;
+using TGetGroupListGid = gid_t;
#endif
#elif defined(_win_)
#include <string>
@@ -57,31 +57,31 @@ namespace {
constexpr static size_t DATA_BUFFER_SIZE = 128 * 1024;
#if defined(_unix_)
- void SetUserGroups(const passwd* pw) {
- int ngroups = 1;
+ void SetUserGroups(const passwd* pw) {
+ int ngroups = 1;
THolder<gid_t, TFree> groups = THolder<gid_t, TFree>(static_cast<gid_t*>(malloc(ngroups * sizeof(gid_t))));
- if (getgrouplist(pw->pw_name, pw->pw_gid, reinterpret_cast<TGetGroupListGid*>(groups.Get()), &ngroups) == -1) {
- groups.Reset(static_cast<gid_t*>(malloc(ngroups * sizeof(gid_t))));
- if (getgrouplist(pw->pw_name, pw->pw_gid, reinterpret_cast<TGetGroupListGid*>(groups.Get()), &ngroups) == -1) {
- ythrow TSystemError() << "getgrouplist failed: user " << pw->pw_name << " (" << pw->pw_uid << ")";
- }
- }
- if (setgroups(ngroups, groups.Get()) == -1) {
- ythrow TSystemError(errno) << "Unable to set groups for user " << pw->pw_name << Endl;
- }
- }
-
- void ImpersonateUser(const TShellCommandOptions::TUserOptions& userOpts) {
- if (GetUsername() == userOpts.Name) {
+ if (getgrouplist(pw->pw_name, pw->pw_gid, reinterpret_cast<TGetGroupListGid*>(groups.Get()), &ngroups) == -1) {
+ groups.Reset(static_cast<gid_t*>(malloc(ngroups * sizeof(gid_t))));
+ if (getgrouplist(pw->pw_name, pw->pw_gid, reinterpret_cast<TGetGroupListGid*>(groups.Get()), &ngroups) == -1) {
+ ythrow TSystemError() << "getgrouplist failed: user " << pw->pw_name << " (" << pw->pw_uid << ")";
+ }
+ }
+ if (setgroups(ngroups, groups.Get()) == -1) {
+ ythrow TSystemError(errno) << "Unable to set groups for user " << pw->pw_name << Endl;
+ }
+ }
+
+ void ImpersonateUser(const TShellCommandOptions::TUserOptions& userOpts) {
+ if (GetUsername() == userOpts.Name) {
return;
}
- const passwd* newUser = getpwnam(userOpts.Name.c_str());
+ const passwd* newUser = getpwnam(userOpts.Name.c_str());
if (!newUser) {
ythrow TSystemError(errno) << "getpwnam failed";
}
- if (userOpts.UseUserGroups) {
- SetUserGroups(newUser);
- }
+ if (userOpts.UseUserGroups) {
+ SetUserGroups(newUser);
+ }
if (setuid(newUser->pw_uid)) {
ythrow TSystemError(errno) << "setuid failed";
}
@@ -727,7 +727,7 @@ void TShellCommand::TImpl::OnFork(TPipes& pipes, sigset_t oldmask, char* const*
}
if (!User.Name.empty()) {
- ImpersonateUser(User);
+ ImpersonateUser(User);
}
if (Nice) {
diff --git a/util/system/shellcommand.h b/util/system/shellcommand.h
index 8730627fe5..977fa538cb 100644
--- a/util/system/shellcommand.h
+++ b/util/system/shellcommand.h
@@ -21,14 +21,14 @@ public:
#if defined(_win_)
TString Password;
#endif
-#if defined(_unix_)
- /**
- * Run child process with the user supplementary groups.
- * If true, the user supplementary groups will be set in the child process upon exec().
- * If false, the supplementary groups of the parent process will be used.
- */
- bool UseUserGroups = false;
-#endif
+#if defined(_unix_)
+ /**
+ * Run child process with the user supplementary groups.
+ * If true, the user supplementary groups will be set in the child process upon exec().
+ * If false, the supplementary groups of the parent process will be used.
+ */
+ bool UseUserGroups = false;
+#endif
};
enum EHandleMode {
@@ -66,7 +66,7 @@ public:
}
/**
- * @brief clear signal mask from parent process. If true, child process
+ * @brief clear signal mask from parent process. If true, child process
* clears the signal mask inherited from the parent process; otherwise
* child process retains the signal mask of the parent process.
*
@@ -80,7 +80,7 @@ public:
}
/**
- * @brief set close-on-exec mode. If true, all file descriptors
+ * @brief set close-on-exec mode. If true, all file descriptors
* from the parent process, except stdin, stdout, stderr, will be closed
* in the child process upon exec().
*
@@ -415,22 +415,22 @@ public:
TProcessId GetPid() const;
/**
- * @brief return the file handle that provides input to the child process
- *
+ * @brief return the file handle that provides input to the child process
+ *
* @return input file handle
*/
TFileHandle& GetInputHandle();
/**
- * @brief return the file handle that provides output from the child process
- *
+ * @brief return the file handle that provides output from the child process
+ *
* @return output file handle
*/
TFileHandle& GetOutputHandle();
/**
- * @brief return the file handle that provides error output from the child process
- *
+ * @brief return the file handle that provides error output from the child process
+ *
* @return error file handle
*/
TFileHandle& GetErrorHandle();
diff --git a/util/ya.make b/util/ya.make
index 6ebe7e40cf..058e1f772d 100644
--- a/util/ya.make
+++ b/util/ya.make
@@ -5,7 +5,7 @@ SUBSCRIBER(g:util-subscribers)
NEED_CHECK()
-NO_UTIL()
+NO_UTIL()
# stream
# string
@@ -36,7 +36,7 @@ SRCS(
string/cast.cpp
)
-IF (OS_WINDOWS)
+IF (OS_WINDOWS)
SRCS(
datetime/strptime.cpp
)
@@ -72,7 +72,7 @@ JOIN_SRCS(
folder/tempdir.cpp
)
-IF (OS_WINDOWS)
+IF (OS_WINDOWS)
SRCS(
folder/lstat_win.c
folder/dirent_win.c
@@ -327,7 +327,7 @@ JOIN_SRCS(
SRC(system/compiler.cpp -fno-lto)
-IF (OS_WINDOWS)
+IF (OS_WINDOWS)
SRCS(
system/fs_win.cpp
system/winint.cpp
@@ -347,7 +347,7 @@ ELSE()
ENDIF()
ENDIF()
-IF (OS_LINUX)
+IF (OS_LINUX)
SRCS(
system/valgrind.cpp
)
@@ -362,7 +362,7 @@ IF (MUSL)
contrib/libs/linuxvdso
)
ELSE()
- IF (OS_LINUX OR SUN OR CYGWIN OR OS_WINDOWS)
+ IF (OS_LINUX OR SUN OR CYGWIN OR OS_WINDOWS)
SRCS(
system/mktemp_system.cpp
)