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 | a7c8d082210c59eaf4478e80d207c304a79b9814 (patch) | |
tree | 08e55b8505f22387dc0fe0942563fdb71f44acb5 | |
parent | f765253b7ae046e7bda5ee8c13903d3c22ab9302 (diff) | |
download | pttbbs-a7c8d082210c59eaf4478e80d207c304a79b9814.tar pttbbs-a7c8d082210c59eaf4478e80d207c304a79b9814.tar.gz pttbbs-a7c8d082210c59eaf4478e80d207c304a79b9814.tar.bz2 pttbbs-a7c8d082210c59eaf4478e80d207c304a79b9814.tar.lz pttbbs-a7c8d082210c59eaf4478e80d207c304a79b9814.tar.xz pttbbs-a7c8d082210c59eaf4478e80d207c304a79b9814.tar.zst pttbbs-a7c8d082210c59eaf4478e80d207c304a79b9814.zip |
* fix setproctitle behavior difference on Linux (prevent long proc titles)
git-svn-id: http://opensvn.csie.org/pttbbs/trunk@4546 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
-rw-r--r-- | pttbbs/mbbsd/mbbsd.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/pttbbs/mbbsd/mbbsd.c b/pttbbs/mbbsd/mbbsd.c index 0ec717a8..c329def7 100644 --- a/pttbbs/mbbsd/mbbsd.c +++ b/pttbbs/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); |