summaryrefslogtreecommitdiffstats
path: root/mbbsd/mbbsd.c
diff options
context:
space:
mode:
authorpiaip <piaip@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2008-04-03 14:32:36 +0800
committerpiaip <piaip@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2008-04-03 14:32:36 +0800
commitf01c33f6bffec99c474f109a31c8481012a83075 (patch)
treefeb254dc325224cdbf9ee40c6494d1e7ce334ee8 /mbbsd/mbbsd.c
parentb25a423c98a1ef5763b9810d554417546214417d (diff)
downloadpttbbs-f01c33f6bffec99c474f109a31c8481012a83075.tar
pttbbs-f01c33f6bffec99c474f109a31c8481012a83075.tar.gz
pttbbs-f01c33f6bffec99c474f109a31c8481012a83075.tar.bz2
pttbbs-f01c33f6bffec99c474f109a31c8481012a83075.tar.lz
pttbbs-f01c33f6bffec99c474f109a31c8481012a83075.tar.xz
pttbbs-f01c33f6bffec99c474f109a31c8481012a83075.tar.zst
pttbbs-f01c33f6bffec99c474f109a31c8481012a83075.zip
- (internal) change mail/log to specific API.
git-svn-id: http://opensvn.csie.org/pttbbs/trunk/pttbbs@4070 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
Diffstat (limited to 'mbbsd/mbbsd.c')
-rw-r--r--mbbsd/mbbsd.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/mbbsd/mbbsd.c b/mbbsd/mbbsd.c
index 23e20f41..d6bcb407 100644
--- a/mbbsd/mbbsd.c
+++ b/mbbsd/mbbsd.c
@@ -181,11 +181,14 @@ u_exit(const char *mode)
close(0);
close(1);
+ // verify if utmp is valid. only flush data if utmp is correct.
assert(strncmp(currutmp->userid,cuser.userid, IDLEN)==0);
if(strncmp(currutmp->userid,cuser.userid, IDLEN)!=0)
return;
- reload_money();
+ auto_backup();
+ save_brdbuf();
+ brc_finalize();
/*
cuser.goodpost = currutmp->goodpost;
cuser.badpost = currutmp->badpost;
@@ -193,11 +196,11 @@ u_exit(const char *mode)
cuser.badsale = currutmp->badsale;
*/
- auto_backup();
+ // no need because in later passwd_update will reload money from SHM.
+ // reload_money();
+
setflags(PAGER_FLAG, currutmp->pager != PAGER_ON);
setflags(CLOAK_FLAG, currutmp->invisible);
- save_brdbuf();
- brc_finalize();
cuser.invisible = currutmp->invisible;
cuser.withme = currutmp->withme;
@@ -211,7 +214,6 @@ u_exit(const char *mode)
do_aloha("<<下站通知>> -- 我走囉!");
}
-
if ((cuser.uflag != enter_uflag) || dirty || diff) {
if (!diff && cuser.numlogins)
cuser.numlogins = --cuser.numlogins;
@@ -300,7 +302,7 @@ abort_bbs_debug(int sig)
/* log */
/* assume vsnprintf() in log_file() is signal-safe, is it? */
log_filef("log/crash.log", LOG_CREAT,
- "%d %d %d %.12s\n", time4(NULL), getpid(), sig, cuser.userid);
+ "%d %d %d %.12s\n", (int)time4(NULL), getpid(), sig, cuser.userid);
/* try logout... not a good idea, maybe crash again. now disabled */
/*