summaryrefslogtreecommitdiffstats
path: root/mbbsd
diff options
context:
space:
mode:
Diffstat (limited to 'mbbsd')
-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);