summaryrefslogtreecommitdiffstats
path: root/mbbsd/cache.c
diff options
context:
space:
mode:
authorin2 <in2@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2005-02-04 00:38:26 +0800
committerin2 <in2@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2005-02-04 00:38:26 +0800
commit87fb00ac1f12f18d1176a4dc1988c8b86a7ef63c (patch)
tree379e723d0f7da3f95919ead8a02e0bd8ba32a524 /mbbsd/cache.c
parent34136f1311cf816b692a703796a9a3ba45bdaf4d (diff)
downloadpttbbs-87fb00ac1f12f18d1176a4dc1988c8b86a7ef63c.tar
pttbbs-87fb00ac1f12f18d1176a4dc1988c8b86a7ef63c.tar.gz
pttbbs-87fb00ac1f12f18d1176a4dc1988c8b86a7ef63c.tar.bz2
pttbbs-87fb00ac1f12f18d1176a4dc1988c8b86a7ef63c.tar.lz
pttbbs-87fb00ac1f12f18d1176a4dc1988c8b86a7ef63c.tar.xz
pttbbs-87fb00ac1f12f18d1176a4dc1988c8b86a7ef63c.tar.zst
pttbbs-87fb00ac1f12f18d1176a4dc1988c8b86a7ef63c.zip
recount n_bottom for each board after reloadbcache
git-svn-id: http://opensvn.csie.org/pttbbs/trunk/pttbbs@2459 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
Diffstat (limited to 'mbbsd/cache.c')
-rw-r--r--mbbsd/cache.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/mbbsd/cache.c b/mbbsd/cache.c
index 41f1b22e..90b73ab8 100644
--- a/mbbsd/cache.c
+++ b/mbbsd/cache.c
@@ -548,6 +548,22 @@ reload_bcache(void)
log_usies("CACHE", "reload bcache");
SHM->Bbusystate = 0;
sort_bcache();
+
+ for( i = 0 ; i < MAX_BOARD ; ++i )
+ if( SHM->bcache[i].brdname[0] ){
+ char fn[128];
+ struct stat st;
+ sprintf(fn, "boards/%c/%s/.DIR.bottom",
+ SHM->bcache[i].brdname[0],
+ SHM->bcache[i].brdname);
+ if( stat(fn, &st) == -1 )
+ SHM->n_bottom[i] = 0;
+ else {
+ SHM->n_bottom[i] = st.st_size / sizeof(fileheader_t);
+ if( SHM->n_bottom[i] > 5 )
+ SHM->n_bottom[i] = 5;
+ }
+ }
}
void resolve_boards(void)