diff options
author | piaip <piaip@63ad8ddf-47c3-0310-b6dd-a9e9d9715204> | 2008-05-05 17:57:21 +0800 |
---|---|---|
committer | piaip <piaip@63ad8ddf-47c3-0310-b6dd-a9e9d9715204> | 2008-05-05 17:57:21 +0800 |
commit | d74ae1e8f983520c4fa0322daeedc9bcc9304710 (patch) | |
tree | 3a04ff9fc8b8b5fee6704e695d132a7cc3f4efb0 /mbbsd/mbbsd.c | |
parent | b31a0e3d53ce17d4626fe125dd1e1f654a0d192c (diff) | |
download | pttbbs-d74ae1e8f983520c4fa0322daeedc9bcc9304710.tar pttbbs-d74ae1e8f983520c4fa0322daeedc9bcc9304710.tar.gz pttbbs-d74ae1e8f983520c4fa0322daeedc9bcc9304710.tar.bz2 pttbbs-d74ae1e8f983520c4fa0322daeedc9bcc9304710.tar.lz pttbbs-d74ae1e8f983520c4fa0322daeedc9bcc9304710.tar.xz pttbbs-d74ae1e8f983520c4fa0322daeedc9bcc9304710.tar.zst pttbbs-d74ae1e8f983520c4fa0322daeedc9bcc9304710.zip |
- (internal) replace all localtime4() by localtime4_r().
git-svn-id: http://opensvn.csie.org/pttbbs/trunk/pttbbs@4272 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
Diffstat (limited to 'mbbsd/mbbsd.c')
-rw-r--r-- | mbbsd/mbbsd.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/mbbsd/mbbsd.c b/mbbsd/mbbsd.c index c0ba2881..c599c524 100644 --- a/mbbsd/mbbsd.c +++ b/mbbsd/mbbsd.c @@ -89,10 +89,11 @@ start_daemon(void) * children, once per connection --- and it does add up. */ time_t dummy = time(NULL); - struct tm *dummy_time = localtime(&dummy); + struct tm dummy_time; char buf[32]; - strftime(buf, sizeof(buf), "%d/%b/%Y:%H:%M:%S", dummy_time); + localtime_r(&dummy, &dummy_time); + strftime(buf, sizeof(buf), "%d/%b/%Y:%H:%M:%S", &dummy_time); #ifndef NO_FORK if ((n = fork())) { @@ -1136,7 +1137,7 @@ user_login(void) * 否則可藉機 race condition 達到 multi-login */ /* get local time */ - ptime = *localtime4(&now); + localtime4_r(&now, &ptime); /* 初始化: random number 增加user跟時間的差異 */ mysrand(); @@ -1165,7 +1166,7 @@ user_login(void) /* 初始化 uinfo、flag、mode */ setup_utmp(LOGIN); enter_uflag = cuser.uflag; - lasttime = *localtime4(&cuser.lastlogin); + localtime4_r(&cuser.lastlogin, &lasttime); redrawwin(); /* mask fromhost a.b.c.d to a.b.c.* */ |