summaryrefslogtreecommitdiffstats
path: root/mbbsd
diff options
context:
space:
mode:
authorwens <wens@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2008-04-09 16:09:29 +0800
committerwens <wens@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2008-04-09 16:09:29 +0800
commit86f83316beabe3496e7cf4ec2718a23ce5e5cb2f (patch)
treee5f2ebf67fc21135d94a7578c1c6578dd2ea206b /mbbsd
parent61dabcb2c84dce8c3ec6a306848f1f53b1c2cdf5 (diff)
downloadpttbbs-86f83316beabe3496e7cf4ec2718a23ce5e5cb2f.tar
pttbbs-86f83316beabe3496e7cf4ec2718a23ce5e5cb2f.tar.gz
pttbbs-86f83316beabe3496e7cf4ec2718a23ce5e5cb2f.tar.bz2
pttbbs-86f83316beabe3496e7cf4ec2718a23ce5e5cb2f.tar.lz
pttbbs-86f83316beabe3496e7cf4ec2718a23ce5e5cb2f.tar.xz
pttbbs-86f83316beabe3496e7cf4ec2718a23ce5e5cb2f.tar.zst
pttbbs-86f83316beabe3496e7cf4ec2718a23ce5e5cb2f.zip
Use fromd for 故鄉
git-svn-id: http://opensvn.csie.org/pttbbs/trunk/pttbbs@4110 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
Diffstat (limited to 'mbbsd')
-rw-r--r--mbbsd/mbbsd.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/mbbsd/mbbsd.c b/mbbsd/mbbsd.c
index bdcbd0a3..b112b821 100644
--- a/mbbsd/mbbsd.c
+++ b/mbbsd/mbbsd.c
@@ -959,7 +959,22 @@ setup_utmp(int mode)
//strlcpy(uinfo.realname, cuser.realname, sizeof(uinfo.realname));
strlcpy(uinfo.nickname, cuser.nickname, sizeof(uinfo.nickname));
strip_nonebig5((unsigned char *)uinfo.nickname, sizeof(uinfo.nickname));
+#ifdef FROMD
+ {
+ int fd;
+ if ( (fd = toconnect(FROMD_HOST, FROMD_PORT)) >= 0 ) {
+ write(fd, fromhost, strlen(fromhost));
+ // uinfo.from is zerod, so we don't care about read length
+ read(fd, uinfo.from, sizeof(uinfo.from));
+ close(fd);
+ }
+ else {
+ strlcpy(uinfo.from, fromhost, sizeof(uinfo.from));
+ }
+ }
+#else
strlcpy(uinfo.from, fromhost, sizeof(uinfo.from));
+#endif
uinfo.five_win = cuser.five_win;
uinfo.five_lose = cuser.five_lose;
uinfo.five_tie = cuser.five_tie;