mirror of
https://github.com/inspircd/inspircd.git
synced 2025-03-10 02:59:01 -04:00
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
This commit is contained in:
parent
01aae0d762
commit
ce4a4abaf2
@ -727,12 +727,19 @@ class InspIRCd : public classbase
|
||||
*/
|
||||
static void Rehash(int status);
|
||||
|
||||
/** Causes the server to exit immediately
|
||||
/** Causes the server to exit after unloading modules and
|
||||
* closing all open file descriptors.
|
||||
*
|
||||
* @param The exit code to give to the operating system
|
||||
* (See the ExitStatus enum for valid values)
|
||||
*/
|
||||
static void Exit(int status);
|
||||
|
||||
/** Causes the server to exit immediately with exit code 0.
|
||||
* The status code is required for signal handlers, and ignored.
|
||||
*/
|
||||
static void QuickExit(int status);
|
||||
|
||||
/** Return a count of users, unknown and known connections
|
||||
* @return The number of users
|
||||
*/
|
||||
|
@ -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);
|
||||
|
Loading…
x
Reference in New Issue
Block a user