summaryrefslogtreecommitdiffstats
path: root/util
diff options
context:
space:
mode:
authorkcwu <kcwu@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2009-05-26 00:28:13 +0800
committerkcwu <kcwu@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2009-05-26 00:28:13 +0800
commitb0dc83e616ebe03a879183e0840d502f207e90cb (patch)
tree1dfec4cf449e95893b133a80b0de1949881c3338 /util
parent715aec67ce259145e9b0d0b67ebafe2980922ae1 (diff)
downloadpttbbs-b0dc83e616ebe03a879183e0840d502f207e90cb.tar
pttbbs-b0dc83e616ebe03a879183e0840d502f207e90cb.tar.gz
pttbbs-b0dc83e616ebe03a879183e0840d502f207e90cb.tar.bz2
pttbbs-b0dc83e616ebe03a879183e0840d502f207e90cb.tar.lz
pttbbs-b0dc83e616ebe03a879183e0840d502f207e90cb.tar.xz
pttbbs-b0dc83e616ebe03a879183e0840d502f207e90cb.tar.zst
pttbbs-b0dc83e616ebe03a879183e0840d502f207e90cb.zip
- mbbsd use getopt() to parse command line options
- many mbbsd code revises and clean up git-svn-id: http://opensvn.csie.org/pttbbs/trunk/pttbbs@4483 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
Diffstat (limited to 'util')
-rw-r--r--util/bbsctl.c8
-rw-r--r--util/bbsrf.c8
2 files changed, 6 insertions, 10 deletions
diff --git a/util/bbsctl.c b/util/bbsctl.c
index cd485ec5..80a57dfa 100644
--- a/util/bbsctl.c
+++ b/util/bbsctl.c
@@ -55,9 +55,9 @@ int startbbs(int argc, char **argv)
exit(1);
}
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);
+ execl(BBSHOME "/bin/mbbsd", "mbbsd", "-d", "-p23", "-p443",
+ "-p3000", "-p3001", "-p3002", "-p3003", "-p3004", "-p3005",
+ "-p3006", "-p3007", "-p3008", "-p3009", "-p3010", NULL);
printf("starting mbbsd failed\n");
return 1;
}
@@ -311,7 +311,7 @@ int bbstest(int argc, char **argv)
return 1;
}
system(KILLALL " testmbbsd");
- execl("./testmbbsd", "testmbbsd", "9000", NULL);
+ execl("./testmbbsd", "testmbbsd", "-d", "-p9000", NULL);
perror("execl()");
return 0;
}
diff --git a/util/bbsrf.c b/util/bbsrf.c
index 04213caa..fdec15d8 100644
--- a/util/bbsrf.c
+++ b/util/bbsrf.c
@@ -53,7 +53,7 @@ static int showbanfile(const char *filename)
int main(void)
{
int uid;
- char *tty, remote_ip[MAX_REMOTE_IP_LEN + 1];
+ char remote_ip[MAX_REMOTE_IP_LEN + 1];
openlog("bbsrf", LOG_PID | LOG_PERROR, LOG_USER);
chdir(BBSHOME);
@@ -75,11 +75,7 @@ int main(void)
get_remote_ip(sizeof(remote_ip), remote_ip);
- tty = ttyname(0);
- if (tty == NULL)
- tty = "notty";
-
- execl(BBSPROG, "mbbsd", remote_ip, tty, NULL);
+ execl(BBSPROG, "mbbsd", "-D", "-h", remote_ip, NULL);
syslog(LOG_ERR, "execl(): %m");
sleep(3); // prevent flooding