From c1b70fdd69c6c025da4f04ad4dbd1b1fd253e75a Mon Sep 17 00:00:00 2001 From: ptt Date: Wed, 12 May 2004 13:55:10 +0000 Subject: update int olny when recommend git-svn-id: http://opensvn.csie.org/pttbbs/trunk/pttbbs@1961 63ad8ddf-47c3-0310-b6dd-a9e9d9715204 --- mbbsd/bbs.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) (limited to 'mbbsd/bbs.c') 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; } -- cgit v1.2.3