From 0e2472de4ee9255a0c26b8cffdbeedb886d57c68 Mon Sep 17 00:00:00 2001 From: wens Date: Thu, 31 Jul 2008 04:42:01 +0000 Subject: close file only if STAMP_FILE git-svn-id: http://opensvn.csie.org/pttbbs/trunk/pttbbs@4391 63ad8ddf-47c3-0310-b6dd-a9e9d9715204 --- common/bbs/fhdr_stamp.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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)); -- cgit v1.2.3