diff options
author | Nikita Slyusarev <nslus@yandex-team.com> | 2022-02-10 16:46:52 +0300 |
---|---|---|
committer | Daniil Cherednik <dcherednik@yandex-team.ru> | 2022-02-10 16:46:52 +0300 |
commit | cd77cecfc03a3eaf87816af28a33067c4f0cdb59 (patch) | |
tree | 1308e0bae862d52e0020d881fe758080437fe389 /util/system | |
parent | cdae02d225fb5b3afbb28990e79a7ac6c9125327 (diff) | |
download | ydb-cd77cecfc03a3eaf87816af28a33067c4f0cdb59.tar.gz |
Restoring authorship annotation for Nikita Slyusarev <nslus@yandex-team.com>. Commit 1 of 2.
Diffstat (limited to 'util/system')
-rw-r--r-- | util/system/benchmark/cpu_id/metrics/ya.make | 4 | ||||
-rw-r--r-- | util/system/benchmark/create_destroy_thread/metrics/ya.make | 4 | ||||
-rw-r--r-- | util/system/benchmark/create_destroy_thread/ya.make | 2 | ||||
-rw-r--r-- | util/system/getpid.cpp | 2 | ||||
-rw-r--r-- | util/system/getpid.h | 18 | ||||
-rw-r--r-- | util/system/getpid_ut.cpp | 2 | ||||
-rw-r--r-- | util/system/shellcommand.cpp | 24 | ||||
-rw-r--r-- | util/system/shellcommand_ut.cpp | 6 | ||||
-rw-r--r-- | util/system/ut/ya.make | 6 |
9 files changed, 34 insertions, 34 deletions
diff --git a/util/system/benchmark/cpu_id/metrics/ya.make b/util/system/benchmark/cpu_id/metrics/ya.make index 8c55def99b..9e36d9c13b 100644 --- a/util/system/benchmark/cpu_id/metrics/ya.make +++ b/util/system/benchmark/cpu_id/metrics/ya.make @@ -14,8 +14,8 @@ TAG( ya:fat ) -TEST_SRCS(main.py) +TEST_SRCS(main.py) -DEPENDS(util/system/benchmark/cpu_id) +DEPENDS(util/system/benchmark/cpu_id) END() diff --git a/util/system/benchmark/create_destroy_thread/metrics/ya.make b/util/system/benchmark/create_destroy_thread/metrics/ya.make index d526487e1a..c5d63db55e 100644 --- a/util/system/benchmark/create_destroy_thread/metrics/ya.make +++ b/util/system/benchmark/create_destroy_thread/metrics/ya.make @@ -14,8 +14,8 @@ TAG( ya:fat ) -TEST_SRCS(main.py) +TEST_SRCS(main.py) -DEPENDS(util/system/benchmark/create_destroy_thread) +DEPENDS(util/system/benchmark/create_destroy_thread) END() diff --git a/util/system/benchmark/create_destroy_thread/ya.make b/util/system/benchmark/create_destroy_thread/ya.make index 03eb0ec8e0..27d120b678 100644 --- a/util/system/benchmark/create_destroy_thread/ya.make +++ b/util/system/benchmark/create_destroy_thread/ya.make @@ -1,4 +1,4 @@ -OWNER(yazevnul) +OWNER(yazevnul) Y_BENCHMARK() diff --git a/util/system/getpid.cpp b/util/system/getpid.cpp index b9615f0dfa..e93123a0cd 100644 --- a/util/system/getpid.cpp +++ b/util/system/getpid.cpp @@ -14,7 +14,7 @@ #include <unistd.h> #endif -TProcessId GetPID() { +TProcessId GetPID() { #ifdef _win_ return GetCurrentProcessId(); #else diff --git a/util/system/getpid.h b/util/system/getpid.h index 60e243266f..8f86d6712d 100644 --- a/util/system/getpid.h +++ b/util/system/getpid.h @@ -1,12 +1,12 @@ #pragma once -#include "platform.h" -#include "types.h" +#include "platform.h" +#include "types.h" -#if defined(_win_) -using TProcessId = ui32; // DWORD -#else -using TProcessId = pid_t; -#endif - -TProcessId GetPID(); +#if defined(_win_) +using TProcessId = ui32; // DWORD +#else +using TProcessId = pid_t; +#endif + +TProcessId GetPID(); diff --git a/util/system/getpid_ut.cpp b/util/system/getpid_ut.cpp index e7122a2971..a3ee6247d1 100644 --- a/util/system/getpid_ut.cpp +++ b/util/system/getpid_ut.cpp @@ -14,6 +14,6 @@ public: UNIT_TEST_SUITE_REGISTRATION(TGetPidTest); void TGetPidTest::Test() { - const TProcessId pid = GetPID(); + const TProcessId pid = GetPID(); UNIT_ASSERT(pid != 0); } diff --git a/util/system/shellcommand.cpp b/util/system/shellcommand.cpp index b1989b5c8c..7c29580e21 100644 --- a/util/system/shellcommand.cpp +++ b/util/system/shellcommand.cpp @@ -15,7 +15,7 @@ #include <util/stream/str.h> #include <util/string/cast.h> #include <util/system/info.h> - + #include <errno.h> #if defined(_unix_) @@ -87,8 +87,8 @@ namespace { } } #elif defined(_win_) - constexpr static size_t MAX_COMMAND_LINE = 32 * 1024; - + constexpr static size_t MAX_COMMAND_LINE = 32 * 1024; + std::wstring GetWString(const char* astring) { if (!astring) return std::wstring(); @@ -400,7 +400,7 @@ public: kill(-Pid, SIGTERM); // between a failed kill(-Pid) and a successful kill(Pid) a grandchild could have been spawned } #else - TerminateProcess(Pid, 1 /* exit code */); + TerminateProcess(Pid, 1 /* exit code */); #endif if (!ok) { ythrow TSystemError() << "cannot terminate " << Pid; @@ -562,10 +562,10 @@ void TShellCommand::TImpl::StartProcess(TShellCommand::TImpl::TPipes& pipes) { // winapi can modify command text, copy it Y_ENSURE_EX(cmd.size() < MAX_COMMAND_LINE, yexception() << "Command is too long (length=" << cmd.size() << ")"); - TTempArray<wchar_t> cmdcopy(MAX_COMMAND_LINE); + TTempArray<wchar_t> cmdcopy(MAX_COMMAND_LINE); Copy(cmd.data(), cmd.data() + cmd.size(), cmdcopy.Data()); *(cmdcopy.Data() + cmd.size()) = 0; - + const wchar_t* cwd = NULL; std::wstring cwdBuff; if (WorkDir.size()) { @@ -591,7 +591,7 @@ void TShellCommand::TImpl::StartProcess(TShellCommand::TImpl::TPipes& pipes) { if (User.Name.empty() || GetUsername() == User.Name) { res = CreateProcessW( nullptr, // image name - cmdcopy.Data(), + cmdcopy.Data(), nullptr, // process security attributes nullptr, // thread security attributes TRUE, // inherit handles - needed for IO, CloseAllFdsOnExec not respected @@ -607,7 +607,7 @@ void TShellCommand::TImpl::StartProcess(TShellCommand::TImpl::TPipes& pipes) { GetWString(User.Password.data()).c_str(), 0, // logon flags NULL, // image name - cmdcopy.Data(), + cmdcopy.Data(), 0, // obscure creation flags lpEnvironment, // environment cwd, // current directory @@ -619,11 +619,11 @@ void TShellCommand::TImpl::StartProcess(TShellCommand::TImpl::TPipes& pipes) { AtomicSet(ExecutionStatus, SHELL_ERROR); /// @todo: write to error stream if set TStringOutput out(CollectedError); - out << "Process was not created: " << LastSystemErrorText() << " command text was: '" << GetAString(cmdcopy.Data()) << "'"; + out << "Process was not created: " << LastSystemErrorText() << " command text was: '" << GetAString(cmdcopy.Data()) << "'"; } - Pid = process_info.hProcess; + Pid = process_info.hProcess; CloseHandle(process_info.hThread); - DBG(Cerr << "created process id " << Pid << " in dir: " << cwd << ", cmd: " << cmdcopy.Data() << Endl); + DBG(Cerr << "created process id " << Pid << " in dir: " << cwd << ", cmd: " << cmdcopy.Data() << Endl); } #endif @@ -1073,7 +1073,7 @@ void TShellCommand::TImpl::Communicate(TProcessInfo* pi) { #else if (waitPidResult == WAIT_OBJECT_0) { DWORD exitCode = STILL_ACTIVE; - if (!GetExitCodeProcess(pi->Parent->Pid, &exitCode)) { + if (!GetExitCodeProcess(pi->Parent->Pid, &exitCode)) { ythrow yexception() << "GetExitCodeProcess: " << LastSystemErrorText(); } if (exitCode == 0) diff --git a/util/system/shellcommand_ut.cpp b/util/system/shellcommand_ut.cpp index 9d849279d2..9791617740 100644 --- a/util/system/shellcommand_ut.cpp +++ b/util/system/shellcommand_ut.cpp @@ -1,5 +1,5 @@ #include "shellcommand.h" - + #include "compat.h" #include "defaults.h" #include "fs.h" @@ -266,7 +266,7 @@ Y_UNIT_TEST_SUITE(TShellCommandTest) { void DoWrite(const void* buf, size_t len) override { Y_UNUSED(buf); Y_UNUSED(len); - } + } void DoFinish() override { ++NumCloses; } @@ -278,7 +278,7 @@ Y_UNIT_TEST_SUITE(TShellCommandTest) { auto options = TShellCommandOptions().SetCloseStreams(true).SetOutputStream(&stream).SetErrorStream(&stream); TShellCommand("echo hello", options).Run().Wait(); - UNIT_ASSERT_VALUES_EQUAL(stream.NumCloses, 2); + UNIT_ASSERT_VALUES_EQUAL(stream.NumCloses, 2); } Y_UNIT_TEST(TestInterruptSimple) { TShellCommandOptions options; diff --git a/util/system/ut/ya.make b/util/system/ut/ya.make index 127e7c261e..8dc3f6b7e1 100644 --- a/util/system/ut/ya.make +++ b/util/system/ut/ya.make @@ -4,11 +4,11 @@ OWNER(g:util) SUBSCRIBER(g:util-subscribers) FORK_TESTS() - + FORK_SUBTESTS() - + SPLIT_FACTOR(40) - + TIMEOUT(300) SIZE(MEDIUM) |