From ce4a4abaf25344a2ac0f56e13770bd49ab776aed Mon Sep 17 00:00:00 2001 From: brain Date: Mon, 26 Mar 2007 16:23:55 +0000 Subject: Fix bug reported by darix where inspircd process returns 15 for successful startup rather than the correct 0 git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@6715 e03df62e-2008-0410-955e-edbf42e46eb7 --- src/inspircd.cpp | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src') diff --git a/src/inspircd.cpp b/src/inspircd.cpp index 6630cde5d..14bff2bef 100644 --- a/src/inspircd.cpp +++ b/src/inspircd.cpp @@ -220,6 +220,11 @@ void InspIRCd::SetSignals() signal(SIGCHLD, SIG_IGN); } +void InspIRCd::QuickExit(int status) +{ + exit(0); +} + bool InspIRCd::DaemonSeed() { int childpid; @@ -234,6 +239,7 @@ bool InspIRCd::DaemonSeed() * if the child pid is still around. If theyre not, * they threw an error and we should give up. */ + signal(SIGTERM, InspIRCd::QuickExit); while (kill(childpid, 0) != -1) sleep(1); exit(0); -- cgit v1.2.3