aboutsummaryrefslogtreecommitdiffstats
path: root/util/system
diff options
context:
space:
mode:
authorAlexander Fokin <apfokin@gmail.com>2022-02-10 16:45:38 +0300
committerDaniil Cherednik <dcherednik@yandex-team.ru>2022-02-10 16:45:38 +0300
commit863a59a65247c24db7cb06789bc5cf79d04da32f (patch)
tree139dc000c8cd4a40f5659e421b7c75135d080307 /util/system
parentf64e95a9eb9ab03240599eb9581c5a9102426a96 (diff)
downloadydb-863a59a65247c24db7cb06789bc5cf79d04da32f.tar.gz
Restoring authorship annotation for Alexander Fokin <apfokin@gmail.com>. Commit 1 of 2.
Diffstat (limited to 'util/system')
-rw-r--r--util/system/backtrace.cpp2
-rw-r--r--util/system/backtrace_ut.cpp2
-rw-r--r--util/system/compiler.h30
-rw-r--r--util/system/defaults.h12
-rw-r--r--util/system/direct_io.h4
-rw-r--r--util/system/execpath.cpp8
-rw-r--r--util/system/file.cpp70
-rw-r--r--util/system/file.h12
-rw-r--r--util/system/file_lock.cpp4
-rw-r--r--util/system/filemap.cpp10
-rw-r--r--util/system/filemap.h6
-rw-r--r--util/system/fs.cpp2
-rw-r--r--util/system/fstat.cpp54
-rw-r--r--util/system/fstat.h18
-rw-r--r--util/system/hostname.cpp2
-rw-r--r--util/system/interrupt_signals.h6
-rw-r--r--util/system/mlock.cpp8
-rw-r--r--util/system/mlock.h50
-rw-r--r--util/system/sem.cpp2
-rw-r--r--util/system/shellcommand.cpp22
-rw-r--r--util/system/shellcommand.h2
21 files changed, 163 insertions, 163 deletions
diff --git a/util/system/backtrace.cpp b/util/system/backtrace.cpp
index b77fe58fb1..a9907b78a0 100644
--- a/util/system/backtrace.cpp
+++ b/util/system/backtrace.cpp
@@ -281,7 +281,7 @@ void TBackTrace::PrintTo(IOutputStream& out) const {
TString TBackTrace::PrintToString() const {
TStringStream ss;
PrintTo(ss);
- return ss.Str();
+ return ss.Str();
}
size_t TBackTrace::size() const {
diff --git a/util/system/backtrace_ut.cpp b/util/system/backtrace_ut.cpp
index 9b5ead71bc..b8240483a5 100644
--- a/util/system/backtrace_ut.cpp
+++ b/util/system/backtrace_ut.cpp
@@ -51,7 +51,7 @@ class TBackTraceTest: public TTestBase {
TStringStream out;
FormatBackTrace(&out);
SetFormatBackTraceFn(prevFn);
- UNIT_ASSERT(out.Str().Contains("WorksLikeACharm"));
+ UNIT_ASSERT(out.Str().Contains("WorksLikeACharm"));
TestPrintBackTrace();
}
diff --git a/util/system/compiler.h b/util/system/compiler.h
index b373edcc46..25035b92d0 100644
--- a/util/system/compiler.h
+++ b/util/system/compiler.h
@@ -52,7 +52,7 @@
#define Y_NO_SANITIZE(...)
#endif
-/**
+/**
* @def Y_DECLARE_UNUSED
*
* Macro is needed to silence compiler warning about unused entities (e.g. function or argument).
@@ -83,12 +83,12 @@
#define Y_PREFETCH_WRITE(Pointer, Priority) __builtin_prefetch((const void*)(Pointer), 1, Priority)
#endif
-/**
+/**
* @def Y_FORCE_INLINE
- *
- * Macro to use in place of 'inline' in function declaration/definition to force
- * it to be inlined.
- */
+ *
+ * Macro to use in place of 'inline' in function declaration/definition to force
+ * it to be inlined.
+ */
#if !defined(Y_FORCE_INLINE)
#if defined(CLANG_COVERAGE)
#/* excessive __always_inline__ might significantly slow down compilation of an instrumented unit */
@@ -101,14 +101,14 @@
#else
#define Y_FORCE_INLINE inline
#endif
-#endif
-
-/**
+#endif
+
+/**
* @def Y_NO_INLINE
- *
- * Macro to use in place of 'inline' in function declaration/definition to
- * prevent it from being inlined.
- */
+ *
+ * Macro to use in place of 'inline' in function declaration/definition to
+ * prevent it from being inlined.
+ */
#if !defined(Y_NO_INLINE)
#if defined(_MSC_VER)
#define Y_NO_INLINE __declspec(noinline)
@@ -118,8 +118,8 @@
#else
#define Y_NO_INLINE
#endif
-#endif
-
+#endif
+
//to cheat compiler about strict aliasing or similar problems
#if defined(__GNUC__)
#define Y_FAKE_READ(X) \
diff --git a/util/system/defaults.h b/util/system/defaults.h
index dcd7abea38..25a3b38f9f 100644
--- a/util/system/defaults.h
+++ b/util/system/defaults.h
@@ -134,12 +134,12 @@ constexpr bool Y_IS_DEBUG_BUILD = true;
#undef Y_ARRAY_END
#define Y_ARRAY_END(arr) ((arr) + Y_ARRAY_SIZE(arr))
-/**
- * Concatenates two symbols, even if one of them is itself a macro.
- */
-#define Y_CAT(X, Y) Y_CAT_I(X, Y)
-#define Y_CAT_I(X, Y) Y_CAT_II(X, Y)
-#define Y_CAT_II(X, Y) X##Y
+/**
+ * Concatenates two symbols, even if one of them is itself a macro.
+ */
+#define Y_CAT(X, Y) Y_CAT_I(X, Y)
+#define Y_CAT_I(X, Y) Y_CAT_II(X, Y)
+#define Y_CAT_II(X, Y) X##Y
#define Y_STRINGIZE(X) UTIL_PRIVATE_STRINGIZE_AUX(X)
#define UTIL_PRIVATE_STRINGIZE_AUX(X) #X
diff --git a/util/system/direct_io.h b/util/system/direct_io.h
index 6a3325a960..0fdde3a847 100644
--- a/util/system/direct_io.h
+++ b/util/system/direct_io.h
@@ -47,11 +47,11 @@ public:
private:
inline bool IsAligned(i64 value) {
- return Alignment ? value == AlignDown<i64>(value, Alignment) : true;
+ return Alignment ? value == AlignDown<i64>(value, Alignment) : true;
}
inline bool IsAligned(const void* value) {
- return Alignment ? value == AlignDown(value, Alignment) : true;
+ return Alignment ? value == AlignDown(value, Alignment) : true;
}
size_t PreadSafe(void* buffer, size_t byteCount, ui64 offset);
diff --git a/util/system/execpath.cpp b/util/system/execpath.cpp
index 33198af58b..ac2141ef03 100644
--- a/util/system/execpath.cpp
+++ b/util/system/execpath.cpp
@@ -158,15 +158,15 @@ static TString GetExecPathImpl() {
static bool GetPersistentExecPathImpl(TString& to) {
#if defined(_solaris_)
to = TString("/proc/self/object/a.out");
- return true;
+ return true;
#elif defined(_linux_) || defined(_cygwin_)
to = TString("/proc/self/exe");
- return true;
+ return true;
#elif defined(_freebsd_)
to = TString("/proc/curproc/file");
- return true;
+ return true;
#else // defined(_win_) || defined(_darwin_) or unknown
- Y_UNUSED(to);
+ Y_UNUSED(to);
return false;
#endif
}
diff --git a/util/system/file.cpp b/util/system/file.cpp
index 4a261d020c..32dd508ded 100644
--- a/util/system/file.cpp
+++ b/util/system/file.cpp
@@ -105,7 +105,7 @@ TFileHandle::TFileHandle(const TString& fName, EOpenMode oMode) noexcept {
// WrOnly or RdWr
faMode |= GENERIC_WRITE;
}
- if (oMode & ::ForAppend) {
+ if (oMode & ::ForAppend) {
faMode |= GENERIC_WRITE;
faMode |= FILE_APPEND_DATA;
faMode &= ~FILE_WRITE_DATA;
@@ -171,7 +171,7 @@ TFileHandle::TFileHandle(const TString& fName, EOpenMode oMode) noexcept {
fcMode |= O_WRONLY;
}
- if (oMode & ::ForAppend) {
+ if (oMode & ::ForAppend) {
fcMode |= O_APPEND;
}
@@ -1243,60 +1243,60 @@ TFile TFile::Temporary(const TString& prefix) {
}
TFile TFile::ForAppend(const TString& path) {
- return TFile(path, OpenAlways | WrOnly | Seq | ::ForAppend);
-}
-
+ return TFile(path, OpenAlways | WrOnly | Seq | ::ForAppend);
+}
+
TFile Duplicate(FILE* f) {
return Duplicate(fileno(f));
}
TFile Duplicate(int fd) {
#if defined(_win_)
- /* There are two options of how to duplicate a file descriptor on Windows:
- *
- * 1:
- * - Call dup.
- * - Call _get_osfhandle on the result.
- * - Use returned handle.
- * - Call _close on file descriptor returned by dup. This will also close
- * the handle.
- *
- * 2:
- * - Call _get_osfhandle.
- * - Call DuplicateHandle on the result.
- * - Use returned handle.
- * - Call CloseHandle.
- *
- * TFileHandle calls CloseHandle when destroyed, leaving us with option #2. */
- FHANDLE handle = reinterpret_cast<FHANDLE>(::_get_osfhandle(fd));
-
- FHANDLE dupHandle;
+ /* There are two options of how to duplicate a file descriptor on Windows:
+ *
+ * 1:
+ * - Call dup.
+ * - Call _get_osfhandle on the result.
+ * - Use returned handle.
+ * - Call _close on file descriptor returned by dup. This will also close
+ * the handle.
+ *
+ * 2:
+ * - Call _get_osfhandle.
+ * - Call DuplicateHandle on the result.
+ * - Use returned handle.
+ * - Call CloseHandle.
+ *
+ * TFileHandle calls CloseHandle when destroyed, leaving us with option #2. */
+ FHANDLE handle = reinterpret_cast<FHANDLE>(::_get_osfhandle(fd));
+
+ FHANDLE dupHandle;
if (!::DuplicateHandle(GetCurrentProcess(), handle, GetCurrentProcess(), &dupHandle, 0, TRUE, DUPLICATE_SAME_ACCESS)) {
ythrow TFileError() << "can not duplicate file descriptor " << LastSystemError() << Endl;
}
-
- return TFile(dupHandle);
+
+ return TFile(dupHandle);
#elif defined(_unix_)
return TFile(::dup(fd));
#else
#error unsupported platform
#endif
}
-
+
bool PosixDisableReadAhead(FHANDLE fileHandle, void* addr) noexcept {
- int ret = -1;
-
-#if HAVE_POSIX_FADVISE
+ int ret = -1;
+
+#if HAVE_POSIX_FADVISE
#if defined(_linux_)
Y_UNUSED(fileHandle);
- ret = madvise(addr, 0, MADV_RANDOM); // according to klamm@ posix_fadvise does not work under linux, madvise does work
+ ret = madvise(addr, 0, MADV_RANDOM); // according to klamm@ posix_fadvise does not work under linux, madvise does work
#else
Y_UNUSED(addr);
ret = ::posix_fadvise(fileHandle, 0, 0, POSIX_FADV_RANDOM);
#endif
-#else
+#else
Y_UNUSED(fileHandle);
Y_UNUSED(addr);
-#endif
- return ret == 0;
-}
+#endif
+ return ret == 0;
+}
diff --git a/util/system/file.h b/util/system/file.h
index 9502e159b6..538d006260 100644
--- a/util/system/file.h
+++ b/util/system/file.h
@@ -71,11 +71,11 @@ public:
}
inline TFileHandle(TFileHandle&& other) noexcept
- : Fd_(other.Fd_)
- {
- other.Fd_ = INVALID_FHANDLE;
- }
-
+ : Fd_(other.Fd_)
+ {
+ other.Fd_ = INVALID_FHANDLE;
+ }
+
TFileHandle(const TString& fName, EOpenMode oMode) noexcept;
inline ~TFileHandle() {
@@ -221,5 +221,5 @@ private:
TFile Duplicate(FILE*);
TFile Duplicate(int);
-
+
bool PosixDisableReadAhead(FHANDLE fileHandle, void* addr) noexcept;
diff --git a/util/system/file_lock.cpp b/util/system/file_lock.cpp
index 45d91282c5..a98018b9db 100644
--- a/util/system/file_lock.cpp
+++ b/util/system/file_lock.cpp
@@ -12,8 +12,8 @@ namespace {
return LOCK_EX;
case EFileLockType::Shared:
return LOCK_SH;
- default:
- Y_UNREACHABLE();
+ default:
+ Y_UNREACHABLE();
}
Y_UNREACHABLE();
}
diff --git a/util/system/filemap.cpp b/util/system/filemap.cpp
index 7454a4cb94..fe39f8525f 100644
--- a/util/system/filemap.cpp
+++ b/util/system/filemap.cpp
@@ -37,10 +37,10 @@
#undef PAGE_SIZE
#undef GRANULARITY
-#ifdef _win_
+#ifdef _win_
#define MAP_FAILED ((void*)(LONG_PTR)-1)
-#endif
-
+#endif
+
namespace {
struct TSysInfo {
inline TSysInfo()
@@ -136,8 +136,8 @@ public:
if (Mapping_ == nullptr) {
ythrow yexception() << "Can't create file mapping of '" << DbgName_ << "': " << LastSystemErrorText();
}
- } else {
- Mapping_ = MAP_FAILED;
+ } else {
+ Mapping_ = MAP_FAILED;
}
#elif defined(_unix_)
if (!(Mode_ & oNotGreedy)) {
diff --git a/util/system/filemap.h b/util/system/filemap.h
index 11be64bff4..94b1425b48 100644
--- a/util/system/filemap.h
+++ b/util/system/filemap.h
@@ -61,9 +61,9 @@ struct TMemoryMapCommon {
Y_DECLARE_FLAGS(EOpenMode, EOpenModeFlag)
/**
- * Name that will be printed in exceptions if not specified.
- * Overridden by name obtained from `TFile` if it's not empty.
- */
+ * Name that will be printed in exceptions if not specified.
+ * Overridden by name obtained from `TFile` if it's not empty.
+ */
static TString UnknownFileName();
};
Y_DECLARE_OPERATORS_FOR_FLAGS(TMemoryMapCommon::EOpenMode)
diff --git a/util/system/fs.cpp b/util/system/fs.cpp
index d2611a8ccc..81f0b15598 100644
--- a/util/system/fs.cpp
+++ b/util/system/fs.cpp
@@ -39,7 +39,7 @@ void NFs::RemoveRecursive(const TString& path) {
TDirIterator dir(path);
- for (auto it = dir.begin(); it != dir.end(); ++it) {
+ for (auto it = dir.begin(); it != dir.end(); ++it) {
switch (it->fts_info) {
case FTS_DOT:
case FTS_D:
diff --git a/util/system/fstat.cpp b/util/system/fstat.cpp
index 81e98cbc6b..2550d66dcd 100644
--- a/util/system/fstat.cpp
+++ b/util/system/fstat.cpp
@@ -133,9 +133,9 @@ TFileStat::TFileStat(const char* fileName, bool nofollow) {
}
bool TFileStat::IsNull() const noexcept {
- return *this == TFileStat();
-}
-
+ return *this == TFileStat();
+}
+
bool TFileStat::IsFile() const noexcept {
return S_ISREG(Mode);
}
@@ -157,12 +157,12 @@ bool operator==(const TFileStat& l, const TFileStat& r) noexcept {
l.ATime == r.ATime &&
l.MTime == r.MTime &&
l.CTime == r.CTime;
-}
-
+}
+
bool operator!=(const TFileStat& l, const TFileStat& r) noexcept {
- return !(l == r);
-}
-
+ return !(l == r);
+}
+
i64 GetFileLength(FHANDLE fd) {
#if defined(_win_)
LARGE_INTEGER pos;
@@ -184,32 +184,32 @@ i64 GetFileLength(FHANDLE fd) {
#error unsupported platform
#endif
}
-
-i64 GetFileLength(const char* name) {
-#if defined(_win_)
- WIN32_FIND_DATA fData;
- HANDLE h = FindFirstFileA(name, &fData);
- if (h == INVALID_HANDLE_VALUE)
- return -1;
- FindClose(h);
- return (((i64)fData.nFileSizeHigh) * (i64(MAXDWORD) + 1)) + (i64)fData.nFileSizeLow;
-#elif defined(_unix_)
- struct stat buf;
- int r = ::stat(name, &buf);
+
+i64 GetFileLength(const char* name) {
+#if defined(_win_)
+ WIN32_FIND_DATA fData;
+ HANDLE h = FindFirstFileA(name, &fData);
+ if (h == INVALID_HANDLE_VALUE)
+ return -1;
+ FindClose(h);
+ return (((i64)fData.nFileSizeHigh) * (i64(MAXDWORD) + 1)) + (i64)fData.nFileSizeLow;
+#elif defined(_unix_)
+ struct stat buf;
+ int r = ::stat(name, &buf);
if (r == -1) {
- return -1;
+ return -1;
}
if (!(buf.st_mode & (S_IFREG | S_IFBLK | S_IFCHR))) {
// st_size only makes sense for regular files or devices
errno = EINVAL;
return -1;
}
- return (i64)buf.st_size;
-#else
+ return (i64)buf.st_size;
+#else
#error unsupported platform
-#endif
-}
-
+#endif
+}
+
i64 GetFileLength(const TString& name) {
return GetFileLength(name.data());
-}
+}
diff --git a/util/system/fstat.h b/util/system/fstat.h
index 64e79e1b55..8b61fb8c89 100644
--- a/util/system/fstat.h
+++ b/util/system/fstat.h
@@ -7,24 +7,24 @@ class TFile;
class TFsPath;
struct TFileStat {
- ui32 Mode = 0; /* protection */
- ui32 Uid = 0; /* user ID of owner */
- ui32 Gid = 0; /* group ID of owner */
+ ui32 Mode = 0; /* protection */
+ ui32 Uid = 0; /* user ID of owner */
+ ui32 Gid = 0; /* group ID of owner */
ui64 NLinks = 0; /* number of hard links */
ui64 Size = 0; /* total size, in bytes */
ui64 INode = 0; /* inode number */
ui64 AllocationSize = 0; /* number of bytes allocated on the disk */
- time_t ATime = 0; /* time of last access */
- time_t MTime = 0; /* time of last modification */
- time_t CTime = 0; /* time of last status change */
+ time_t ATime = 0; /* time of last access */
+ time_t MTime = 0; /* time of last modification */
+ time_t CTime = 0; /* time of last status change */
public:
TFileStat();
bool IsNull() const noexcept;
-
+
bool IsFile() const noexcept;
bool IsDir() const noexcept;
bool IsSymlink() const noexcept;
@@ -37,11 +37,11 @@ public:
friend bool operator==(const TFileStat& l, const TFileStat& r) noexcept;
friend bool operator!=(const TFileStat& l, const TFileStat& r) noexcept;
-
+
private:
void MakeFromFileName(const char* fileName, bool nofollow);
};
i64 GetFileLength(FHANDLE fd);
-i64 GetFileLength(const char* name);
+i64 GetFileLength(const char* name);
i64 GetFileLength(const TString& name);
diff --git a/util/system/hostname.cpp b/util/system/hostname.cpp
index 386f646d6b..8ae33d3d8c 100644
--- a/util/system/hostname.cpp
+++ b/util/system/hostname.cpp
@@ -89,7 +89,7 @@ bool IsFQDN(const TString& name) {
try {
// ResolveHost() can't be used since it is ipv4-only, port is not important
TNetworkAddress addr(absName, 0);
- } catch (const TNetworkResolutionError&) {
+ } catch (const TNetworkResolutionError&) {
return false;
}
return true;
diff --git a/util/system/interrupt_signals.h b/util/system/interrupt_signals.h
index 9f9c2427f1..e869b471ea 100644
--- a/util/system/interrupt_signals.h
+++ b/util/system/interrupt_signals.h
@@ -10,13 +10,13 @@
#endif
#endif
-/**
+/**
* Set handler for interrupt signals.
*
* All OSes: SIGINT, SIGTERM (defined by C++ standard)
* UNIX variants: Also SIGHUP
* Windows: CTRL_C_EVENT handled as SIGINT, CTRL_BREAK_EVENT as SIGTERM, CTRL_CLOSE_EVENT as SIGHUP
- *
- * \param handler Signal handler to use. Pass nullptr to clear currently set handler.
+ *
+ * \param handler Signal handler to use. Pass nullptr to clear currently set handler.
*/
void SetInterruptSignalsHandler(void (*handler)(int signum));
diff --git a/util/system/mlock.cpp b/util/system/mlock.cpp
index 435338c98f..df4891e219 100644
--- a/util/system/mlock.cpp
+++ b/util/system/mlock.cpp
@@ -52,18 +52,18 @@ void UnlockMemory(const void* addr, size_t len) {
#endif
}
-void LockAllMemory(ELockAllMemoryFlags flags) {
- Y_UNUSED(flags);
+void LockAllMemory(ELockAllMemoryFlags flags) {
+ Y_UNUSED(flags);
#if defined(_android_)
// unimplemented
#elif defined(_cygwin_)
// unimplemented
#elif defined(_unix_)
int sys_flags = 0;
- if (flags & LockCurrentMemory) {
+ if (flags & LockCurrentMemory) {
sys_flags |= MCL_CURRENT;
}
- if (flags & LockFutureMemory) {
+ if (flags & LockFutureMemory) {
sys_flags |= MCL_FUTURE;
}
if (flags & LockMemoryOnFault) {
diff --git a/util/system/mlock.h b/util/system/mlock.h
index f021c0fe67..06075c3f25 100644
--- a/util/system/mlock.h
+++ b/util/system/mlock.h
@@ -2,8 +2,8 @@
#include "defaults.h"
-#include <util/generic/flags.h>
-
+#include <util/generic/flags.h>
+
//on some systems (not win, freebd, linux, but darwin (Mac OS X)
//multiple mlock calls on the same address range
//require the corresponding number of munlock calls to actually unlock the pages
@@ -13,31 +13,31 @@
void LockMemory(const void* addr, size_t len);
void UnlockMemory(const void* addr, size_t len);
-enum ELockAllMemoryFlag {
- /** Lock all pages which are currently mapped into the address space of the process. */
- LockCurrentMemory = 1,
-
- /** Lock all pages which will become mapped into the address space of the process in the future. */
- LockFutureMemory = 2,
+enum ELockAllMemoryFlag {
+ /** Lock all pages which are currently mapped into the address space of the process. */
+ LockCurrentMemory = 1,
+
+ /** Lock all pages which will become mapped into the address space of the process in the future. */
+ LockFutureMemory = 2,
/** Since Linux 4.4, with LockCurrentMemory or LockFutureMemory or both, lock only pages that are or once they are present in memory. */
LockMemoryOnFault = 4,
};
-Y_DECLARE_FLAGS(ELockAllMemoryFlags, ELockAllMemoryFlag)
-Y_DECLARE_OPERATORS_FOR_FLAGS(ELockAllMemoryFlags)
-
-/**
- * Performs provided locking operation.
- *
- * Does nothing on windows.
- *
- * \param flags Locking operation to perform.
- */
-void LockAllMemory(ELockAllMemoryFlags flags);
-
-/**
- * Unlocks whatever was locked with a previous call to `LockAllMemory`.
- *
- * Does nothing on windows.
- */
+Y_DECLARE_FLAGS(ELockAllMemoryFlags, ELockAllMemoryFlag)
+Y_DECLARE_OPERATORS_FOR_FLAGS(ELockAllMemoryFlags)
+
+/**
+ * Performs provided locking operation.
+ *
+ * Does nothing on windows.
+ *
+ * \param flags Locking operation to perform.
+ */
+void LockAllMemory(ELockAllMemoryFlags flags);
+
+/**
+ * Unlocks whatever was locked with a previous call to `LockAllMemory`.
+ *
+ * Does nothing on windows.
+ */
void UnlockAllMemory();
diff --git a/util/system/sem.cpp b/util/system/sem.cpp
index 4a93b903b5..9a7392b845 100644
--- a/util/system/sem.cpp
+++ b/util/system/sem.cpp
@@ -239,7 +239,7 @@ bool TSemaphore::TryAcquire() noexcept {
return Impl_->TryAcquire();
}
-#if defined(_unix_) && !defined(_darwin_)
+#if defined(_unix_) && !defined(_darwin_)
class TFastSemaphore::TImpl: public TPosixSemaphore {
public:
inline TImpl(ui32 n)
diff --git a/util/system/shellcommand.cpp b/util/system/shellcommand.cpp
index b1989b5c8c..1cebdec47b 100644
--- a/util/system/shellcommand.cpp
+++ b/util/system/shellcommand.cpp
@@ -24,7 +24,7 @@
#include <grp.h>
#include <sys/wait.h>
-using TPid = pid_t;
+using TPid = pid_t;
using TWaitResult = pid_t;
using TExitStatus = int;
#define WAIT_PROCEED 0
@@ -39,7 +39,7 @@ using TGetGroupListGid = gid_t;
#include "winint.h"
-using TPid = HANDLE;
+using TPid = HANDLE;
using TWaitResult = DWORD;
using TExitStatus = DWORD;
#define WAIT_PROCEED WAIT_TIMEOUT
@@ -190,7 +190,7 @@ using REALPIPEHANDLE = PIPEHANDLE;
class TShellCommand::TImpl
: public TAtomicRefCount<TShellCommand::TImpl> {
private:
- TPid Pid;
+ TPid Pid;
TString Command;
TList<TString> Arguments;
TString WorkDir;
@@ -367,11 +367,11 @@ public:
}
inline TProcessId GetPid() const {
-#if defined(_win_)
- return GetProcessId(Pid);
-#else
+#if defined(_win_)
+ return GetProcessId(Pid);
+#else
return Pid;
-#endif
+#endif
}
inline TFileHandle& GetInputHandle() {
@@ -949,10 +949,10 @@ void TShellCommand::TImpl::Communicate(TProcessInfo* pi) {
}
/// @todo factor out (poll + wfmo)
#if defined(_unix_)
- bool haveIn = false;
- bool haveOut = false;
- bool haveErr = false;
-
+ bool haveIn = false;
+ bool haveOut = false;
+ bool haveErr = false;
+
if (!input && pi->InputFd.IsOpen()) {
DBG(Cerr << "closing input stream..." << Endl);
pi->InputFd.Close();
diff --git a/util/system/shellcommand.h b/util/system/shellcommand.h
index 8730627fe5..5abff75c10 100644
--- a/util/system/shellcommand.h
+++ b/util/system/shellcommand.h
@@ -408,7 +408,7 @@ public:
/**
* @brief get id of underlying process
- * @note depends on os: pid_t on UNIX, HANDLE on win
+ * @note depends on os: pid_t on UNIX, HANDLE on win
*
* @return pid or handle
*/