summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorwens <wens@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2008-07-31 12:42:01 +0800
committerwens <wens@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2008-07-31 12:42:01 +0800
commit0e2472de4ee9255a0c26b8cffdbeedb886d57c68 (patch)
tree6e7c06580253cc9e07ff6ac67e82fd2218ea3a99
parented0ba2cc1f2adaa7d50a4e6bb2490b52c9bd1917 (diff)
downloadpttbbs-0e2472de4ee9255a0c26b8cffdbeedb886d57c68.tar
pttbbs-0e2472de4ee9255a0c26b8cffdbeedb886d57c68.tar.gz
pttbbs-0e2472de4ee9255a0c26b8cffdbeedb886d57c68.tar.bz2
pttbbs-0e2472de4ee9255a0c26b8cffdbeedb886d57c68.tar.lz
pttbbs-0e2472de4ee9255a0c26b8cffdbeedb886d57c68.tar.xz
pttbbs-0e2472de4ee9255a0c26b8cffdbeedb886d57c68.tar.zst
pttbbs-0e2472de4ee9255a0c26b8cffdbeedb886d57c68.zip
close file only if STAMP_FILE
git-svn-id: http://opensvn.csie.org/pttbbs/trunk/pttbbs@4391 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
-rw-r--r--common/bbs/fhdr_stamp.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/common/bbs/fhdr_stamp.c b/common/bbs/fhdr_stamp.c
index 05c9bccf..ac9acb6a 100644
--- a/common/bbs/fhdr_stamp.c
+++ b/common/bbs/fhdr_stamp.c
@@ -65,7 +65,9 @@ fhdr_stamp(char *fpath, fileheader_t *fh, int type)
if (res == -1)
return -1;
- close(res);
+
+ if (type == STAMP_FILE)
+ close(res);
memset(fh, 0, sizeof(fileheader_t));
strlcpy(fh->filename, ip, sizeof(fh->filename));