summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorvictor <victor@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2005-01-15 11:36:22 +0800
committervictor <victor@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2005-01-15 11:36:22 +0800
commit9543925aff0625b90e8e1dee0a691766e8ed5447 (patch)
tree151c05bd1b2efbed2f4193406066c09d681720b8
parent9dd03ea1cc5d09b19d5b45964758b1a742bd2151 (diff)
downloadpttbbs-9543925aff0625b90e8e1dee0a691766e8ed5447.tar
pttbbs-9543925aff0625b90e8e1dee0a691766e8ed5447.tar.gz
pttbbs-9543925aff0625b90e8e1dee0a691766e8ed5447.tar.bz2
pttbbs-9543925aff0625b90e8e1dee0a691766e8ed5447.tar.lz
pttbbs-9543925aff0625b90e8e1dee0a691766e8ed5447.tar.xz
pttbbs-9543925aff0625b90e8e1dee0a691766e8ed5447.tar.zst
pttbbs-9543925aff0625b90e8e1dee0a691766e8ed5447.zip
revert
git-svn-id: http://opensvn.csie.org/pttbbs/trunk/pttbbs@2399 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
-rw-r--r--mbbsd/fav.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/mbbsd/fav.c b/mbbsd/fav.c
index 1e978c25..b2a267df 100644
--- a/mbbsd/fav.c
+++ b/mbbsd/fav.c
@@ -455,7 +455,6 @@ static void read_favrec(int fd, fav_t *fp)
/**
* 從記錄檔中 load 出我的最愛。
- * @note fav_cleanup() 會先被呼叫。
*/
int fav_load(void)
{
@@ -479,9 +478,8 @@ int fav_load(void)
return -1;
fp = (fav_t *)fav_malloc(sizeof(fav_t));
read_favrec(fd, fp);
- close(fd);
fav_stack_push_fav(fp);
- fav_cleanup();
+ close(fd);
#ifdef MEM_CHECK
fav_set_memcheck(MEM_CHECK);
#endif
@@ -513,7 +511,7 @@ static void write_favrec(int fd, fav_t *fp)
/**
* 把記錄檔 save 進我的最愛。
- * @note fav_cleanup() 在 fav_load() 時做,避免看板欄掉時,下站被搞亂 fav。
+ * @note fav_cleanup() 會先被呼叫。
*/
int fav_save(void)
{
@@ -526,6 +524,7 @@ int fav_save(void)
#endif
if (fp == NULL)
return -1;
+ fav_cleanup();
setuserfile(buf, FAV4".tmp");
setuserfile(buf2, FAV4);
fd = open(buf, O_CREAT | O_WRONLY, 0600);