summaryrefslogtreecommitdiffstats
path: root/util/util_cache.c
diff options
context:
space:
mode:
authorptt <ptt@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2002-06-29 21:50:46 +0800
committerptt <ptt@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2002-06-29 21:50:46 +0800
commit4c2c59e33a17407453b34493ccd0e3fd7a6f4da6 (patch)
tree3a810bdc0f007d6f759ef140c056a68d321aada6 /util/util_cache.c
parent6a118d17eed23598f46a293e96831f94a768811e (diff)
downloadpttbbs-4c2c59e33a17407453b34493ccd0e3fd7a6f4da6.tar
pttbbs-4c2c59e33a17407453b34493ccd0e3fd7a6f4da6.tar.gz
pttbbs-4c2c59e33a17407453b34493ccd0e3fd7a6f4da6.tar.bz2
pttbbs-4c2c59e33a17407453b34493ccd0e3fd7a6f4da6.tar.lz
pttbbs-4c2c59e33a17407453b34493ccd0e3fd7a6f4da6.tar.xz
pttbbs-4c2c59e33a17407453b34493ccd0e3fd7a6f4da6.tar.zst
pttbbs-4c2c59e33a17407453b34493ccd0e3fd7a6f4da6.zip
try toplazyBM
git-svn-id: http://opensvn.csie.org/pttbbs/pttbbs/trunk/pttbbs@375 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
Diffstat (limited to 'util/util_cache.c')
-rw-r--r--util/util_cache.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/util/util_cache.c b/util/util_cache.c
index 4a53cd2c..4cf0ff1f 100644
--- a/util/util_cache.c
+++ b/util/util_cache.c
@@ -1,4 +1,4 @@
-/* $Id: util_cache.c,v 1.4 2002/06/09 12:51:07 in2 Exp $ */
+/* $Id: util_cache.c,v 1.5 2002/06/29 13:50:46 ptt Exp $ */
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
@@ -339,14 +339,17 @@ void touch_boards() {
void reset_board(int bid)
{
int fd;
+ boardheader_t bh;
if(--bid<0)return;
if(SHM->Bbusystate==0)
{
SHM->Bbusystate = 1;
if((fd = open(fn_board, O_RDONLY)) > 0) {
lseek(fd, (off_t)(bid * sizeof(boardheader_t)), SEEK_SET);
- read(fd, &bcache[bid], sizeof(boardheader_t));
+ read(fd, &bh , sizeof(boardheader_t));
close(fd);
+ if(bh.brdname[0] && !strcmp(bh.brdname,bcache[bid].brdname))
+ memcpy(&bcache[bid],&bh, sizeof(boardheader_t));
}
SHM->Bbusystate = 0;
}