summaryrefslogtreecommitdiff
path: root/src/inspircd.cpp
diff options
context:
space:
mode:
authorbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2004-05-09 13:14:32 +0000
committerbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2004-05-09 13:14:32 +0000
commit3fdab8ea4af40635c0f950be4c9edbc56f1a9053 (patch)
treef8ae5e537a3ec2f8df9026d34fe7c95e80d34c6d /src/inspircd.cpp
parent02203e5243b18b9044320ecf291c3948cc80b150 (diff)
Added support for /RESTART (currently has a bug, do not use)
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@800 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src/inspircd.cpp')
-rw-r--r--src/inspircd.cpp26
1 files changed, 20 insertions, 6 deletions
diff --git a/src/inspircd.cpp b/src/inspircd.cpp
index 6a6359b6e..48460b369 100644
--- a/src/inspircd.cpp
+++ b/src/inspircd.cpp
@@ -174,7 +174,7 @@ address_cache IP;
ClassVector Classes;
struct linger linger = { 0 };
-char bannerBuffer[MAXBUF];
+char MyExecutable[1024];
int boundPortCount = 0;
int portCount = 0, UDPportCount = 0, ports[MAXSOCKS];
int defaultRoute = 0;
@@ -2000,7 +2000,7 @@ void Error(int status)
}
-int main(int argc, char *argv[])
+int main(int argc, char **argv)
{
Start();
srand(time(NULL));
@@ -2013,10 +2013,18 @@ int main(int argc, char *argv[])
Exit(ERROR);
}
if (argc > 1) {
- if (!strcmp(argv[1],"-nofork")) {
- nofork = true;
+ for (int i = 1; i < argc; i++)
+ {
+ if (!strcmp(argv[i],"-nofork")) {
+ nofork = true;
+ }
+ if (!strcmp(argv[i],"-wait")) {
+ sleep(6);
+ }
}
}
+ strcpy(MyExecutable,argv[0]);
+
if (InspIRCd() == ERROR)
{
log(DEBUG,"main: daemon function bailed");
@@ -3174,8 +3182,14 @@ int InspIRCd(void)
log(DEBUG,"InspIRCd: startup: binding '%s:%s' is default server route",Addr,configToken);
}
me[count3] = new serverrec(ServerName,100L,false);
- me[count3]->CreateListener(Addr,atoi(configToken));
- count3++;
+ if (!me[count3]->CreateListener(Addr,atoi(configToken)))
+ {
+ log(DEFAULT,"Error! Failed to bind port %d",atoi(configToken));
+ }
+ else
+ {
+ count3++;
+ }
}
else
{