summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorptt <ptt@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2004-05-12 21:55:10 +0800
committerptt <ptt@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2004-05-12 21:55:10 +0800
commitc1b70fdd69c6c025da4f04ad4dbd1b1fd253e75a (patch)
tree49593e4efb2ccae8ee17051fd07cc742ef1848e2
parentd044c958c8acf4cd0dff6fed337d485b9c0f30a4 (diff)
downloadpttbbs-c1b70fdd69c6c025da4f04ad4dbd1b1fd253e75a.tar
pttbbs-c1b70fdd69c6c025da4f04ad4dbd1b1fd253e75a.tar.gz
pttbbs-c1b70fdd69c6c025da4f04ad4dbd1b1fd253e75a.tar.bz2
pttbbs-c1b70fdd69c6c025da4f04ad4dbd1b1fd253e75a.tar.lz
pttbbs-c1b70fdd69c6c025da4f04ad4dbd1b1fd253e75a.tar.xz
pttbbs-c1b70fdd69c6c025da4f04ad4dbd1b1fd253e75a.tar.zst
pttbbs-c1b70fdd69c6c025da4f04ad4dbd1b1fd253e75a.zip
update int olny when recommend
git-svn-id: http://opensvn.csie.org/pttbbs/trunk/pttbbs@1961 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
-rw-r--r--mbbsd/bbs.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/mbbsd/bbs.c b/mbbsd/bbs.c
index 19fd7c67..d615f94c 100644
--- a/mbbsd/bbs.c
+++ b/mbbsd/bbs.c
@@ -1335,21 +1335,18 @@ do_add_recommend(char *direct, fileheader_t *fhdr, int ent, char *buf, int type)
update = -1;
if( update ){
+ int fd;
get_record(direct, fhdr, sizeof(fhdr), ent);
fhdr->recommend += update;
- substitute_record(direct, fhdr, sizeof(fhdr), ent);
-/*
- Ptt: update only necessary
-
+ //Ptt: update only necessary
if( (fd = open(direct, O_WRONLY)) < 0 )
return -1;
if( lseek(fd, (off_t)(sizeof(*fhdr) * (ent - 1) +
- (int)&t.recommend - (int)&t), SEEK_SET) >= 0)
+ (int)fhdr->recommend - (int)fhdr), SEEK_SET) >= 0)
// 如果 lseek 失敗就不會 write
write(fd, &fhdr->recommend, sizeof(char));
close(fd);
-*/
}
return 0;
}