aboutsummaryrefslogtreecommitdiffstats
path: root/util/system
diff options
context:
space:
mode:
authoraosipenko <aosipenko@yandex-team.ru>2022-02-10 16:48:08 +0300
committerDaniil Cherednik <dcherednik@yandex-team.ru>2022-02-10 16:48:08 +0300
commit69e3c43df1c96bc2ac8946bf4dfb1f5fc438ff7f (patch)
treeb222e5ac2e2e98872661c51ccceee5da0d291e13 /util/system
parent948fd24d47d4b3b7815aaef1686aea00ef3f4288 (diff)
downloadydb-69e3c43df1c96bc2ac8946bf4dfb1f5fc438ff7f.tar.gz
Restoring authorship annotation for <aosipenko@yandex-team.ru>. Commit 2 of 2.
Diffstat (limited to 'util/system')
-rw-r--r--util/system/compat.h2
-rw-r--r--util/system/compiler.h4
-rw-r--r--util/system/context.cpp2
-rw-r--r--util/system/daemon.cpp6
-rw-r--r--util/system/defaults.h2
-rw-r--r--util/system/direct_io.cpp2
-rw-r--r--util/system/error.cpp26
-rw-r--r--util/system/file.cpp10
-rw-r--r--util/system/file_ut.cpp4
-rw-r--r--util/system/filemap.cpp2
-rw-r--r--util/system/fs_win.h2
-rw-r--r--util/system/maxlen.h4
-rw-r--r--util/system/shellcommand.cpp6
-rw-r--r--util/system/src_location.cpp18
-rw-r--r--util/system/src_root_ut.cpp4
-rw-r--r--util/system/thread.cpp6
-rw-r--r--util/system/types_ut.cpp40
-rw-r--r--util/system/ut/ya.make2
-rw-r--r--util/system/yassert.cpp4
19 files changed, 73 insertions, 73 deletions
diff --git a/util/system/compat.h b/util/system/compat.h
index 67f1b2af27..c53dbcca17 100644
--- a/util/system/compat.h
+++ b/util/system/compat.h
@@ -28,7 +28,7 @@ extern "C" {
#define SIGALRM 14 //will not receive under win?
#endif
-#if defined(__FreeBSD__) || defined(_darwin_)
+#if defined(__FreeBSD__) || defined(_darwin_)
#define HAVE_NATIVE_GETPROGNAME
#endif
diff --git a/util/system/compiler.h b/util/system/compiler.h
index de93b5240d..b373edcc46 100644
--- a/util/system/compiler.h
+++ b/util/system/compiler.h
@@ -76,7 +76,7 @@
#define Y_DECLARE_UNUSED
#endif
-#if defined(__GNUC__)
+#if defined(__GNUC__)
#define Y_LIKELY(Cond) __builtin_expect(!!(Cond), 1)
#define Y_UNLIKELY(Cond) __builtin_expect(!!(Cond), 0)
#define Y_PREFETCH_READ(Pointer, Priority) __builtin_prefetch((const void*)(Pointer), 0, Priority)
@@ -163,7 +163,7 @@
#define Y_PACKED
#endif
-#if defined(__GNUC__)
+#if defined(__GNUC__)
#define Y_WARN_UNUSED_RESULT __attribute__((warn_unused_result))
#endif
diff --git a/util/system/context.cpp b/util/system/context.cpp
index b3ba4bf13d..ad99309088 100644
--- a/util/system/context.cpp
+++ b/util/system/context.cpp
@@ -217,7 +217,7 @@ void ContextTrampoLine(void* arg) {
#endif
#if defined(USE_FIBER_CONT)
-TContMachineContext::TContMachineContext()
+TContMachineContext::TContMachineContext()
: Fiber_(ConvertThreadToFiber(this))
, MainFiber_(true)
{
diff --git a/util/system/daemon.cpp b/util/system/daemon.cpp
index f7c3106242..130e6c8f45 100644
--- a/util/system/daemon.cpp
+++ b/util/system/daemon.cpp
@@ -85,11 +85,11 @@ bool NDaemonMaker::MakeMeDaemon(ECloseDescriptors cd, EStdIoDescriptors iod, ECh
return true;
}
- if (chd == chdirRoot) {
+ if (chd == chdirRoot) {
if (chdir("/")) {
- ythrow TSystemError() << "chdir(\"/\") failed";
+ ythrow TSystemError() << "chdir(\"/\") failed";
}
- }
+ }
int fd[4] = {-1, -1, -1, -1};
switch (iod) {
diff --git a/util/system/defaults.h b/util/system/defaults.h
index b5b3b4569b..dcd7abea38 100644
--- a/util/system/defaults.h
+++ b/util/system/defaults.h
@@ -56,7 +56,7 @@
#define _must_align2_
#endif
-#if defined(__GNUC__)
+#if defined(__GNUC__)
#define alias_hack __attribute__((__may_alias__))
#endif
diff --git a/util/system/direct_io.cpp b/util/system/direct_io.cpp
index c6328127b8..f59c54b0cb 100644
--- a/util/system/direct_io.cpp
+++ b/util/system/direct_io.cpp
@@ -87,7 +87,7 @@ void TDirectIOBufferedFile::SetDirectIO(bool value) {
DirectIO = value;
#else
- DirectIO = value;
+ DirectIO = value;
#endif
}
diff --git a/util/system/error.cpp b/util/system/error.cpp
index a33c09badf..f778ec42cb 100644
--- a/util/system/error.cpp
+++ b/util/system/error.cpp
@@ -67,22 +67,22 @@ const char* LastSystemErrorText(int code) {
#endif
}
-#ifdef _win_
-static char* Strip(char* s) {
- size_t len = strlen(s);
- const char* ptr = s;
- Strip(ptr, len);
- if (ptr != s)
- memmove(s, ptr, len);
- s[len] = 0;
- return s;
-}
-#endif // _win_
-
+#ifdef _win_
+static char* Strip(char* s) {
+ size_t len = strlen(s);
+ const char* ptr = s;
+ Strip(ptr, len);
+ if (ptr != s)
+ memmove(s, ptr, len);
+ s[len] = 0;
+ return s;
+}
+#endif // _win_
+
void LastSystemErrorText(char* str, size_t size, int code) {
#if defined(_win_)
FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM, 0, code, 0, str, DWORD(size), 0);
- Strip(str);
+ Strip(str);
#elif defined(_sun_)
strfcpy(str, strerror(code), size);
#elif defined(_freebsd_) || defined(_darwin_) || defined(_musl_) || defined(_bionic_)
diff --git a/util/system/file.cpp b/util/system/file.cpp
index c971df64e2..4a261d020c 100644
--- a/util/system/file.cpp
+++ b/util/system/file.cpp
@@ -86,10 +86,10 @@ TFileHandle::TFileHandle(const TString& fName, EOpenMode oMode) noexcept {
case OpenAlways:
fcMode = OPEN_ALWAYS;
break;
- case CreateNew:
+ case CreateNew:
fcMode = CREATE_NEW;
break;
- case CreateAlways:
+ case CreateAlways:
fcMode = CREATE_ALWAYS;
break;
default:
@@ -152,10 +152,10 @@ TFileHandle::TFileHandle(const TString& fName, EOpenMode oMode) noexcept {
case OpenAlways:
fcMode = O_CREAT;
break;
- case CreateNew:
+ case CreateNew:
fcMode = O_CREAT | O_EXCL;
break;
- case CreateAlways:
+ case CreateAlways:
fcMode = O_CREAT | O_TRUNC;
break;
default:
@@ -417,7 +417,7 @@ bool TFileHandle::Flush() noexcept {
return false;
}
#if defined(_win_)
- bool ok = ::FlushFileBuffers(Fd_) != 0;
+ bool ok = ::FlushFileBuffers(Fd_) != 0;
/*
* FlushFileBuffers fails if hFile is a handle to the console output.
* That is because the console output is not buffered.
diff --git a/util/system/file_ut.cpp b/util/system/file_ut.cpp
index d22f412b37..941e6a50f3 100644
--- a/util/system/file_ut.cpp
+++ b/util/system/file_ut.cpp
@@ -143,7 +143,7 @@ void TFileTest::TestOpen() {
UNIT_ASSERT_VALUES_EQUAL(f1.GetLength(), 0);
try {
- TFile f2("f1.txt", CreateNew);
+ TFile f2("f1.txt", CreateNew);
} catch (const yexception& e) {
res = e.what();
}
@@ -163,7 +163,7 @@ void TFileTest::TestOpenSync() {
}
void TFileTest::TestRW() {
- TFile f1("f1.txt", CreateNew);
+ TFile f1("f1.txt", CreateNew);
UNIT_ASSERT(f1.IsOpen());
UNIT_ASSERT_VALUES_EQUAL(f1.GetName(), "f1.txt");
UNIT_ASSERT_VALUES_EQUAL(f1.GetLength(), 0);
diff --git a/util/system/filemap.cpp b/util/system/filemap.cpp
index 41d6244e6d..7454a4cb94 100644
--- a/util/system/filemap.cpp
+++ b/util/system/filemap.cpp
@@ -34,7 +34,7 @@
#include <util/system/sanitizers.h>
#include "filemap.h"
-#undef PAGE_SIZE
+#undef PAGE_SIZE
#undef GRANULARITY
#ifdef _win_
diff --git a/util/system/fs_win.h b/util/system/fs_win.h
index b863c456ba..8086129828 100644
--- a/util/system/fs_win.h
+++ b/util/system/fs_win.h
@@ -3,7 +3,7 @@
#include "winint.h"
#include "defaults.h"
-#include <util/generic/strbuf.h>
+#include <util/generic/strbuf.h>
#include <util/generic/string.h>
namespace NFsPrivate {
diff --git a/util/system/maxlen.h b/util/system/maxlen.h
index 483c7a4fb5..e1ff7f5008 100644
--- a/util/system/maxlen.h
+++ b/util/system/maxlen.h
@@ -1,7 +1,7 @@
#pragma once
-#include <cstdlib>
-
+#include <cstdlib>
+
// http://support.microsoft.com/kb/208427
#ifndef URL_MAXLEN
#define URL_MAXLEN 2083
diff --git a/util/system/shellcommand.cpp b/util/system/shellcommand.cpp
index f939953bf2..b1989b5c8c 100644
--- a/util/system/shellcommand.cpp
+++ b/util/system/shellcommand.cpp
@@ -43,7 +43,7 @@ using TPid = HANDLE;
using TWaitResult = DWORD;
using TExitStatus = DWORD;
#define WAIT_PROCEED WAIT_TIMEOUT
-
+
#pragma warning(disable : 4296) // 'wait_result >= WAIT_OBJECT_0' : expression is always tru
#else
#error("unknown os, shell command is not implemented")
@@ -618,7 +618,7 @@ void TShellCommand::TImpl::StartProcess(TShellCommand::TImpl::TPipes& pipes) {
if (!res) {
AtomicSet(ExecutionStatus, SHELL_ERROR);
/// @todo: write to error stream if set
- TStringOutput out(CollectedError);
+ TStringOutput out(CollectedError);
out << "Process was not created: " << LastSystemErrorText() << " command text was: '" << GetAString(cmdcopy.Data()) << "'";
}
Pid = process_info.hProcess;
@@ -925,7 +925,7 @@ void TShellCommand::TImpl::Communicate(TProcessInfo* pi) {
char* bufPos = nullptr;
#endif
TWaitResult waitPidResult;
- TExitStatus status = 0;
+ TExitStatus status = 0;
while (true) {
{
diff --git a/util/system/src_location.cpp b/util/system/src_location.cpp
index def480add9..13ff1f24b3 100644
--- a/util/system/src_location.cpp
+++ b/util/system/src_location.cpp
@@ -2,16 +2,16 @@
#include <util/stream/output.h>
-#include <algorithm>
-
+#include <algorithm>
+
template <>
void Out<TSourceLocation>(IOutputStream& o, const TSourceLocation& t) {
-#if defined(_win_)
+#if defined(_win_)
TString file(t.File);
- std::replace(file.begin(), file.vend(), '\\', '/');
- o << file;
-#else
- o << t.File;
-#endif
- o << ':' << t.Line;
+ std::replace(file.begin(), file.vend(), '\\', '/');
+ o << file;
+#else
+ o << t.File;
+#endif
+ o << ':' << t.Line;
}
diff --git a/util/system/src_root_ut.cpp b/util/system/src_root_ut.cpp
index 7b65a0a36d..e9a675eb9a 100644
--- a/util/system/src_root_ut.cpp
+++ b/util/system/src_root_ut.cpp
@@ -1,11 +1,11 @@
#include "src_root.h"
-#include <util/folder/pathsplit.h>
+#include <util/folder/pathsplit.h>
#include <library/cpp/testing/unittest/registar.h>
Y_UNIT_TEST_SUITE(TestSourceRoot) {
Y_UNIT_TEST(TestStrip) {
- // Reconstruct() converts "\" -> "/" on Windows
+ // Reconstruct() converts "\" -> "/" on Windows
const TString path = TPathSplit(__SOURCE_FILE_IMPL__.As<TStringBuf>()).Reconstruct();
UNIT_ASSERT_EQUAL(path, "util" LOCSLASH_S "system" LOCSLASH_S "src_root_ut.cpp");
}
diff --git a/util/system/thread.cpp b/util/system/thread.cpp
index d7615776b8..6236746c2d 100644
--- a/util/system/thread.cpp
+++ b/util/system/thread.cpp
@@ -43,7 +43,7 @@ namespace {
inline void SetThrName(const TParams& p) {
try {
- if (p.Name) {
+ if (p.Name) {
TThread::SetCurrentThreadName(p.Name.data());
}
} catch (...) {
@@ -107,7 +107,7 @@ namespace {
}
static ui32 __stdcall Proxy(void* ptr) {
- NTls::TCleaner cleaner;
+ NTls::TCleaner cleaner;
(void)cleaner;
@@ -313,7 +313,7 @@ void TThread::Detach() {
}
bool TThread::Running() const noexcept {
- return Impl_ && Impl_->Running();
+ return Impl_ && Impl_->Running();
}
TThread::TId TThread::Id() const noexcept {
diff --git a/util/system/types_ut.cpp b/util/system/types_ut.cpp
index 0ee71d6f03..19e40cef46 100644
--- a/util/system/types_ut.cpp
+++ b/util/system/types_ut.cpp
@@ -1,23 +1,23 @@
-#include "types.h"
-
+#include "types.h"
+
#include <library/cpp/testing/unittest/registar.h>
-
+
Y_UNIT_TEST_SUITE(TestTypes) {
Y_UNIT_TEST(TestScanf) {
- i32 val32 = 0;
- sscanf("-123", "%" SCNi32, &val32);
- UNIT_ASSERT(val32 == -123);
- sscanf("234", "%" SCNu32, &val32);
- UNIT_ASSERT(val32 == 234);
- sscanf("159", "%" SCNx32, &val32);
- UNIT_ASSERT(val32 == 345);
-
- i64 val64 = 0;
- sscanf("-123", "%" SCNi64, &val64);
- UNIT_ASSERT(val64 == -123);
- sscanf("234", "%" SCNu64, &val64);
- UNIT_ASSERT(val64 == 234);
- sscanf("159", "%" SCNx64, &val64);
- UNIT_ASSERT(val64 == 345);
- }
-}
+ i32 val32 = 0;
+ sscanf("-123", "%" SCNi32, &val32);
+ UNIT_ASSERT(val32 == -123);
+ sscanf("234", "%" SCNu32, &val32);
+ UNIT_ASSERT(val32 == 234);
+ sscanf("159", "%" SCNx32, &val32);
+ UNIT_ASSERT(val32 == 345);
+
+ i64 val64 = 0;
+ sscanf("-123", "%" SCNi64, &val64);
+ UNIT_ASSERT(val64 == -123);
+ sscanf("234", "%" SCNu64, &val64);
+ UNIT_ASSERT(val64 == 234);
+ sscanf("159", "%" SCNx64, &val64);
+ UNIT_ASSERT(val64 == 345);
+ }
+}
diff --git a/util/system/ut/ya.make b/util/system/ut/ya.make
index 4871c632a8..127e7c261e 100644
--- a/util/system/ut/ya.make
+++ b/util/system/ut/ya.make
@@ -70,7 +70,7 @@ SRCS(
system/tempfile_ut.cpp
system/thread_ut.cpp
system/tls_ut.cpp
- system/types_ut.cpp
+ system/types_ut.cpp
system/type_name_ut.cpp
system/user_ut.cpp
system/unaligned_mem_ut.cpp
diff --git a/util/system/yassert.cpp b/util/system/yassert.cpp
index 58a0bce2cf..0f586648b7 100644
--- a/util/system/yassert.cpp
+++ b/util/system/yassert.cpp
@@ -67,13 +67,13 @@ namespace NPrivate {
TString r;
TStringOutput o(r);
- if (expr) {
+ if (expr) {
o << "VERIFY failed (" << now << "): " << errorMsg << Endl;
} else {
o << "FAIL (" << now << "): " << errorMsg << Endl;
}
o << " " << file << ":" << line << Endl;
- if (expr) {
+ if (expr) {
o << " " << function << "(): requirement " << expr << " failed" << Endl;
} else {
o << " " << function << "() failed" << Endl;