From: Maxim Mamontov <faust@gts.dp.ua>
Date: Mon, 11 Apr 2011 12:56:54 +0000 (+0300)
Subject: Remove wait after fork in rscriptd
X-Git-Tag: 2.407-rc3~12
X-Git-Url: https://git.stg.codes/stg.git/commitdiff_plain/5df6bcf398aca8c5cfe1e61f1794c88504145c3b?ds=inline

Remove wait after fork in rscriptd
---

diff --git a/projects/rscriptd/main.cpp b/projects/rscriptd/main.cpp
index 714da320..8cf9384d 100644
--- a/projects/rscriptd/main.cpp
+++ b/projects/rscriptd/main.cpp
@@ -256,8 +256,6 @@ int ForkAndWait(const string & confDir)
 {
 #ifndef NO_DAEMON
 stgChildPid = fork();
-string startFile = confDir + START_FILE;
-unlink(startFile.c_str());
 
 switch (stgChildPid)
     {
@@ -273,23 +271,6 @@ switch (stgChildPid)
         break;
 
     default:    // Parent
-        for (int i = 0; i < 120 * 5; i++)
-            {
-            if (access(startFile.c_str(), F_OK) == 0)
-                {
-                //printf("Fork successfull. Exit.\n");
-                unlink(startFile.c_str());
-                exit(0);
-                }
-
-            if (childExited)
-                {
-                unlink(startFile.c_str());
-                exit(1);
-                }
-            usleep(200000);
-            }
-        unlink(startFile.c_str());
         exit(1);
         break;
     }
@@ -407,11 +388,6 @@ listener->Start();
 WriteServLog("rscriptd started successfully.");
 WriteServLog("+++++++++++++++++++++++++++++++++++++++++++++");
 
-#ifndef NO_DAEMON
-string startFile(confDir + START_FILE);
-creat(startFile.c_str(), S_IRUSR);
-#endif
-
 while (nonstop.GetStatus())
     {
     usleep(100000);