From dd9eca51e92987ecb9eb244b61c5c9bfcfb9f1c4 Mon Sep 17 00:00:00 2001 From: piaip Date: Wed, 10 Jun 2009 15:50:27 +0000 Subject: * on Linux, argv0 is modified after *every* setproctitle. fix previous check-in. git-svn-id: http://opensvn.csie.org/pttbbs/trunk/pttbbs@4547 63ad8ddf-47c3-0310-b6dd-a9e9d9715204 --- mbbsd/mbbsd.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'mbbsd') diff --git a/mbbsd/mbbsd.c b/mbbsd/mbbsd.c index c329def7..278627d5 100644 --- a/mbbsd/mbbsd.c +++ b/mbbsd/mbbsd.c @@ -1839,12 +1839,6 @@ tunnel_login(char *argv0, struct ProgramOption *option) setuid(BBSUID); chdir(BBSHOME); - /* proctitle */ -#ifndef VALGRIND - 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",pid); @@ -1856,6 +1850,12 @@ tunnel_login(char *argv0, struct ProgramOption *option) // XXX on Linux, argv0 will change if you setproctitle. strlcpy(buf, argv0, sizeof(buf)); + /* proctitle */ +#ifndef VALGRIND + snprintf(margs, sizeof(margs), "%s tunnel(%u) ", buf, pid); + setproctitle("%s: listening ", margs); +#endif + /* main loop */ while( 1 ) { -- cgit v1.2.3