aboutsummaryrefslogtreecommitdiffstats
path: root/util/system
diff options
context:
space:
mode:
authordimko <dimko@yandex-team.ru>2022-02-10 16:50:07 +0300
committerDaniil Cherednik <dcherednik@yandex-team.ru>2022-02-10 16:50:07 +0300
commit5df1bbceafd25528f800dbe399738150b20384f3 (patch)
tree9dda05f18a06906442e3deff7861fccc32c2c260 /util/system
parenta0e29f0026d32a60a618a620f30035c264346175 (diff)
downloadydb-5df1bbceafd25528f800dbe399738150b20384f3.tar.gz
Restoring authorship annotation for <dimko@yandex-team.ru>. Commit 1 of 2.
Diffstat (limited to 'util/system')
-rw-r--r--util/system/daemon.cpp16
-rw-r--r--util/system/daemon.h4
-rw-r--r--util/system/error.cpp4
3 files changed, 12 insertions, 12 deletions
diff --git a/util/system/daemon.cpp b/util/system/daemon.cpp
index 130e6c8f45..68c3dc9d55 100644
--- a/util/system/daemon.cpp
+++ b/util/system/daemon.cpp
@@ -13,13 +13,13 @@
#endif
#include "daemon.h"
-
-#ifdef _unix_
+
+#ifdef _unix_
using namespace NDaemonMaker;
-
+
static bool Fork(EParent parent) {
pid_t pid = fork();
-
+
if (pid > 0) {
int status = 0;
while (waitpid(pid, &status, 0) < 0 && errno == EINTR) {
@@ -32,13 +32,13 @@ static bool Fork(EParent parent) {
} else if (pid < 0) {
ythrow TSystemError() << "Cannot fork";
}
-
+
if (setsid() < 0) {
ythrow TSystemError() << "Cannot setsid";
}
-
+
pid = fork();
-
+
if (pid > 0) {
_exit(0);
} else if (pid < 0) {
@@ -46,7 +46,7 @@ static bool Fork(EParent parent) {
}
return false;
}
-
+
#endif
static void CloseFromToExcept(int from, int to, const int* except) {
diff --git a/util/system/daemon.h b/util/system/daemon.h
index b00793b9c9..8ed6fb67c7 100644
--- a/util/system/daemon.h
+++ b/util/system/daemon.h
@@ -1,11 +1,11 @@
#pragma once
-
+
namespace NDaemonMaker {
enum ECloseDescriptors {
closeAll = 0,
closeStdIoOnly
};
-
+
enum EStdIoDescriptors {
openNone = 0,
openDevNull,
diff --git a/util/system/error.cpp b/util/system/error.cpp
index f778ec42cb..a9f782127f 100644
--- a/util/system/error.cpp
+++ b/util/system/error.cpp
@@ -84,9 +84,9 @@ void LastSystemErrorText(char* str, size_t size, int code) {
FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM, 0, code, 0, str, DWORD(size), 0);
Strip(str);
#elif defined(_sun_)
- strfcpy(str, strerror(code), size);
+ strfcpy(str, strerror(code), size);
#elif defined(_freebsd_) || defined(_darwin_) || defined(_musl_) || defined(_bionic_)
- strerror_r(code, str, size);
+ strerror_r(code, str, size);
#elif defined(_linux_) | defined(_cygwin_)
char* msg = strerror_r(code, str, size);
strncpy(str, msg, size);