From 599e2456f937c71b45b8b863990fdf31ca7d6f86 Mon Sep 17 00:00:00 2001 From: piaip Date: Wed, 10 Jun 2009 13:50:28 +0000 Subject: * 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 --- mbbsd/mbbsd.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'mbbsd') 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); -- cgit v1.2.3