Commit 37efe51e authored by jan.koester's avatar jan.koester
Browse files

test

parent 13104f1d
Loading
Loading
Loading
Loading
+15 −0
Changes for src/blogi.cpp: 15 added lines, 0 removed lines.
Original line number Diff line number Diff line
@@ -3793,6 +3793,21 @@ int main(int argc, char *argv[])

          if (!fground)
            {
                // Daemonize: fork once so the invoking shell/rc script regains control
                // immediately. Everything below (including the pre-fork supervisor's
                // watchdog loop, which never returns) runs in the detached child.
                pid_t daemonizePid = fork();
                if (daemonizePid > 0)
                {
                    return 0;
                }
                else if (daemonizePid < 0)
                {
                    std::cerr << "fork failed: " << strerror(errno) << std::endl;
                    return -1;
                }
                setsid();

                size_t domainCount = blogi::Blogi::Cfg->getDomainCount();
                if (domainCount > 0)
                {