summaryrefslogtreecommitdiffstats
path: root/mbbsd/bbs.c
diff options
context:
space:
mode:
Diffstat (limited to 'mbbsd/bbs.c')
-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;
}