summaryrefslogtreecommitdiffstats
path: root/util/system/daemon.cpp
diff options
context:
space:
mode:
authordimko <[email protected]>2022-02-10 16:50:07 +0300
committerDaniil Cherednik <[email protected]>2022-02-10 16:50:07 +0300
commit5df1bbceafd25528f800dbe399738150b20384f3 (patch)
tree9dda05f18a06906442e3deff7861fccc32c2c260 /util/system/daemon.cpp
parenta0e29f0026d32a60a618a620f30035c264346175 (diff)
Restoring authorship annotation for <[email protected]>. Commit 1 of 2.
Diffstat (limited to 'util/system/daemon.cpp')
-rw-r--r--util/system/daemon.cpp16
1 files changed, 8 insertions, 8 deletions
diff --git a/util/system/daemon.cpp b/util/system/daemon.cpp
index 130e6c8f45e..68c3dc9d558 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) {