diff options
author | piaip <piaip@63ad8ddf-47c3-0310-b6dd-a9e9d9715204> | 2009-06-10 22:04:38 +0800 |
---|---|---|
committer | piaip <piaip@63ad8ddf-47c3-0310-b6dd-a9e9d9715204> | 2009-06-10 22:04:38 +0800 |
commit | 29580695cf2ceed6b34024946d1fc181c744c34b (patch) | |
tree | a6f0d34da2b7b44dbeaf19742bf8126ca7da9515 /mbbsd | |
parent | b5e2d75fcf9f4e8a346a01b090d63c70ee9de8c3 (diff) | |
download | pttbbs-29580695cf2ceed6b34024946d1fc181c744c34b.tar pttbbs-29580695cf2ceed6b34024946d1fc181c744c34b.tar.gz pttbbs-29580695cf2ceed6b34024946d1fc181c744c34b.tar.bz2 pttbbs-29580695cf2ceed6b34024946d1fc181c744c34b.tar.lz pttbbs-29580695cf2ceed6b34024946d1fc181c744c34b.tar.xz pttbbs-29580695cf2ceed6b34024946d1fc181c744c34b.tar.zst pttbbs-29580695cf2ceed6b34024946d1fc181c744c34b.zip |
* fix setproctitle behavior difference on Linux (prevent long proc titles)
git-svn-id: http://opensvn.csie.org/pttbbs/trunk/pttbbs@4546 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
Diffstat (limited to 'mbbsd')
-rw-r--r-- | mbbsd/mbbsd.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/mbbsd/mbbsd.c b/mbbsd/mbbsd.c index 0ec717a8..c329def7 100644 --- a/mbbsd/mbbsd.c +++ b/mbbsd/mbbsd.c @@ -1853,6 +1853,9 @@ tunnel_login(char *argv0, struct ProgramOption *option) fclose(fp); } + // XXX on Linux, argv0 will change if you setproctitle. + strlcpy(buf, argv0, sizeof(buf)); + /* main loop */ while( 1 ) { @@ -1882,7 +1885,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); + snprintf(margs, sizeof(margs), "%s tunnel(%u)-%s ", buf, pid, dat.port); setproctitle("%s: ...login wait... ", margs); #endif close(tunnel); |