summaryrefslogtreecommitdiffstats
path: root/mbbsd
diff options
context:
space:
mode:
authorpiaip <piaip@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2009-06-10 23:50:27 +0800
committerpiaip <piaip@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2009-06-10 23:50:27 +0800
commitdd9eca51e92987ecb9eb244b61c5c9bfcfb9f1c4 (patch)
tree37ea7c01fbca0fc36e98d006d30400fb212c355d /mbbsd
parent29580695cf2ceed6b34024946d1fc181c744c34b (diff)
downloadpttbbs-dd9eca51e92987ecb9eb244b61c5c9bfcfb9f1c4.tar
pttbbs-dd9eca51e92987ecb9eb244b61c5c9bfcfb9f1c4.tar.gz
pttbbs-dd9eca51e92987ecb9eb244b61c5c9bfcfb9f1c4.tar.bz2
pttbbs-dd9eca51e92987ecb9eb244b61c5c9bfcfb9f1c4.tar.lz
pttbbs-dd9eca51e92987ecb9eb244b61c5c9bfcfb9f1c4.tar.xz
pttbbs-dd9eca51e92987ecb9eb244b61c5c9bfcfb9f1c4.tar.zst
pttbbs-dd9eca51e92987ecb9eb244b61c5c9bfcfb9f1c4.zip
* 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
Diffstat (limited to 'mbbsd')
-rw-r--r--mbbsd/mbbsd.c12
1 files changed, 6 insertions, 6 deletions
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 )
{