diff options
author | victor <victor@63ad8ddf-47c3-0310-b6dd-a9e9d9715204> | 2003-11-22 14:46:09 +0800 |
---|---|---|
committer | victor <victor@63ad8ddf-47c3-0310-b6dd-a9e9d9715204> | 2003-11-22 14:46:09 +0800 |
commit | f66f843371f1508cbbeeff1c5174aefeb14fa436 (patch) | |
tree | ebe19095aab54dc60f23ac1470abe43925fc448c /mbbsd | |
parent | 555081ec91dd63b3130416be9f3ecc54163e479d (diff) | |
download | pttbbs-f66f843371f1508cbbeeff1c5174aefeb14fa436.tar pttbbs-f66f843371f1508cbbeeff1c5174aefeb14fa436.tar.gz pttbbs-f66f843371f1508cbbeeff1c5174aefeb14fa436.tar.bz2 pttbbs-f66f843371f1508cbbeeff1c5174aefeb14fa436.tar.lz pttbbs-f66f843371f1508cbbeeff1c5174aefeb14fa436.tar.xz pttbbs-f66f843371f1508cbbeeff1c5174aefeb14fa436.tar.zst pttbbs-f66f843371f1508cbbeeff1c5174aefeb14fa436.zip |
missing close(fd)
git-svn-id: http://opensvn.csie.org/pttbbs/trunk/pttbbs@1359 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
Diffstat (limited to 'mbbsd')
-rw-r--r-- | mbbsd/fav.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/mbbsd/fav.c b/mbbsd/fav.c index 6590e57e..9479979e 100644 --- a/mbbsd/fav.c +++ b/mbbsd/fav.c @@ -866,18 +866,17 @@ int fav_v3_to_v4(void) fav3_board_t *brd; setuserfile(buf, FAV4); - fd = open(buf, O_RDONLY); - if (fd >= 0){ - close(fd); + if (dashf(buf)) return 0; - } fdw = open(buf, O_WRONLY | O_CREAT | O_TRUNC, 0600); if (fdw < 0) return -1; setuserfile(buf, FAV3); fd = open(buf, O_RDONLY); - if (fd < 0) + if (fd < 0) { + close(fdw); return -1; + } read(fd, &nDatas, sizeof(nDatas)); read(fd, &nLines, sizeof(nLines)); @@ -917,5 +916,7 @@ int fav_v3_to_v4(void) write_favrec(fdw, fav4); fav_free_branch(fav4); free(brd); + close(fd); + close(fdw); return 0; } |