summaryrefslogtreecommitdiffstats
path: root/mbbsd/mbbsd.c
diff options
context:
space:
mode:
authorpiaip <piaip@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2009-06-10 21:50:28 +0800
committerpiaip <piaip@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2009-06-10 21:50:28 +0800
commit599e2456f937c71b45b8b863990fdf31ca7d6f86 (patch)
treeef80a2fcd72bf99b87ee77fb030c5b51a7e005a0 /mbbsd/mbbsd.c
parent91cc2285dea7480b293aa32690a5df9a3e91bc16 (diff)
downloadpttbbs-599e2456f937c71b45b8b863990fdf31ca7d6f86.tar
pttbbs-599e2456f937c71b45b8b863990fdf31ca7d6f86.tar.gz
pttbbs-599e2456f937c71b45b8b863990fdf31ca7d6f86.tar.bz2
pttbbs-599e2456f937c71b45b8b863990fdf31ca7d6f86.tar.lz
pttbbs-599e2456f937c71b45b8b863990fdf31ca7d6f86.tar.xz
pttbbs-599e2456f937c71b45b8b863990fdf31ca7d6f86.tar.zst
pttbbs-599e2456f937c71b45b8b863990fdf31ca7d6f86.zip
* refine logind: deliver port info and add more keys
git-svn-id: http://opensvn.csie.org/pttbbs/trunk/pttbbs@4543 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
Diffstat (limited to 'mbbsd/mbbsd.c')
-rw-r--r--mbbsd/mbbsd.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/mbbsd/mbbsd.c b/mbbsd/mbbsd.c
index e9ace21f..0ec717a8 100644
--- a/mbbsd/mbbsd.c
+++ b/mbbsd/mbbsd.c
@@ -1753,6 +1753,9 @@ main(int argc, char *argv[], char *envp[])
if (option->tunnel_mode)
{
+ // force reset attribute because tunnel may not have enough time
+ // to flush output...
+ output(ANSI_RESET, sizeof(ANSI_RESET)-1);
move(b_lines-1, 0);
outs("µn¤J¤¤¡A½Ðµy­Ô...");
doupdate();
@@ -1811,6 +1814,7 @@ static int
tunnel_login(char *argv0, struct ProgramOption *option)
{
int tunnel = 0, csock = 0, success = 1;
+ unsigned int pid = (unsigned int)getpid();
struct login_data dat = {0};
char buf[PATHLEN];
FILE *fp;
@@ -1837,13 +1841,13 @@ tunnel_login(char *argv0, struct ProgramOption *option)
/* proctitle */
#ifndef VALGRIND
- snprintf(margs, sizeof(margs), "%s tunnel=%u ", argv0, (unsigned int)getpid());
+ snprintf(margs, sizeof(margs), "%s tunnel(%u) ", argv0, pid);
setproctitle("%s: listening ", margs);
#endif
// log pid
snprintf(buf, sizeof(buf),
- "run/mbbsd.%s.%u.pid", "tunnel", (unsigned int)getpid());
+ "run/mbbsd.%s.%u.pid", "tunnel",pid);
if ((fp = fopen(buf, "w"))) {
fprintf(fp, "%d\n", (int)getpid());
fclose(fp);
@@ -1878,6 +1882,7 @@ tunnel_login(char *argv0, struct ProgramOption *option)
/* here is only child running */
#ifndef VALGRIND
+ snprintf(margs, sizeof(margs), "%s tunnel(%u)-%s ", argv0, pid, dat.port);
setproctitle("%s: ...login wait... ", margs);
#endif
close(tunnel);