summaryrefslogtreecommitdiffstats
path: root/util/bbsctl.c
diff options
context:
space:
mode:
authorin2 <in2@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2005-10-21 04:03:13 +0800
committerin2 <in2@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2005-10-21 04:03:13 +0800
commit600422d4c70829782cde54cd6b27fc25d6a24871 (patch)
tree7a671585c841e317e182ae5eac356a0dc062979f /util/bbsctl.c
parentdac02d5bd1e21c5dae7308cdaf1ceb782e41d78b (diff)
downloadpttbbs-600422d4c70829782cde54cd6b27fc25d6a24871.tar
pttbbs-600422d4c70829782cde54cd6b27fc25d6a24871.tar.gz
pttbbs-600422d4c70829782cde54cd6b27fc25d6a24871.tar.bz2
pttbbs-600422d4c70829782cde54cd6b27fc25d6a24871.tar.lz
pttbbs-600422d4c70829782cde54cd6b27fc25d6a24871.tar.xz
pttbbs-600422d4c70829782cde54cd6b27fc25d6a24871.tar.zst
pttbbs-600422d4c70829782cde54cd6b27fc25d6a24871.zip
single daemon for all ports
git-svn-id: http://opensvn.csie.org/pttbbs/trunk/pttbbs@3228 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
Diffstat (limited to 'util/bbsctl.c')
-rw-r--r--util/bbsctl.c26
1 files changed, 5 insertions, 21 deletions
diff --git a/util/bbsctl.c b/util/bbsctl.c
index 079e7738..7710795c 100644
--- a/util/bbsctl.c
+++ b/util/bbsctl.c
@@ -48,31 +48,15 @@ int HaveBBSADM(void)
int startbbs(int argc, char **argv)
{
- int i;
- char *port[] = {"3000", "3001", "3002", "3003", "3004", "3005",
- "3006", "3007", "3008", "3009", "3010", NULL};
- pid_t pid;
-
- for( i = 0 ; port[i] != NULL ; ++i ){
- if( (pid = fork()) < 0 ){
- perror("fork()");
- return 1;
- }
- else if( pid == 0 ){
- printf("starting mbbsd at port %s\n", port[i]);
- execl(BBSHOME "/bin/mbbsd", "mbbsd", port[i], NULL);
- printf("start port[%s] failed\n", port[i]);
- return 1;
- }
- }
-
if( setuid(0) < 0 ){
perror("setuid(0)");
exit(1);
}
- printf("starting mbbsd at port %s\n", "23");
- execl(BBSHOME "/bin/mbbsd", "mbbsd", "23", NULL);
- printf("start port[%s] failed\n", "23");
+ printf("starting mbbsd at 23, 443, 3000-3010\n");
+ execl(BBSHOME "/bin/mbbsd", "mbbsd", "23", "443",
+ "3000", "3001", "3002", "3003", "3004", "3005",
+ "3006", "3007", "3008", "3009", "3010", NULL);
+ printf("starting mbbsd failed\n");
return 1;
}