diff options
author | Nikita Slyusarev <nslus@yandex-team.com> | 2022-02-10 16:46:53 +0300 |
---|---|---|
committer | Daniil Cherednik <dcherednik@yandex-team.ru> | 2022-02-10 16:46:53 +0300 |
commit | 469afdc4e2587bf62ecdd096b75a0baa444c4012 (patch) | |
tree | 49e222ea1c5804306084bb3ae065bb702625360f /util/system | |
parent | cd77cecfc03a3eaf87816af28a33067c4f0cdb59 (diff) | |
download | ydb-469afdc4e2587bf62ecdd096b75a0baa444c4012.tar.gz |
Restoring authorship annotation for Nikita Slyusarev <nslus@yandex-team.com>. Commit 2 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 9e36d9c13b..8c55def99b 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 c5d63db55e..d526487e1a 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 27d120b678..03eb0ec8e0 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 e93123a0cd..b9615f0dfa 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 8f86d6712d..60e243266f 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 a3ee6247d1..e7122a2971 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 7c29580e21..b1989b5c8c 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 9791617740..9d849279d2 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 8dc3f6b7e1..127e7c261e 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) |