From 67afb777945003a7ca2bedd2c301a8a1f62fc589 Mon Sep 17 00:00:00 2001 From: in2 Date: Fri, 19 Apr 2002 12:10:09 +0000 Subject: fix bug(MDCACHE) git-svn-id: http://opensvn.csie.org/pttbbs/pttbbs/trunk/pttbbs@124 63ad8ddf-47c3-0310-b6dd-a9e9d9715204 --- mbbsd/cache.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'mbbsd') diff --git a/mbbsd/cache.c b/mbbsd/cache.c index 1be9d32a..94e8edfc 100644 --- a/mbbsd/cache.c +++ b/mbbsd/cache.c @@ -1,4 +1,4 @@ -/* $Id: cache.c,v 1.18 2002/04/18 21:27:23 in2 Exp $ */ +/* $Id: cache.c,v 1.19 2002/04/19 12:10:09 in2 Exp $ */ #include #include #include @@ -1048,7 +1048,7 @@ int updatemdcache(const char *CPATH, const char *fpath) cpath = (CPATH == NULL) ? cachepath(fpath) : (char *)CPATH; if( (sourcefd = open(fpath, O_RDONLY)) < 0 ) return -1; - if( (targetfd = open(cpath, O_RDWR | O_CREAT, 0600)) < 0 ) + if( (targetfd = open(cpath, O_RDWR | O_CREAT | O_TRUNC, 0600)) < 0 ) /* md is full? */ return -1; while( (len = read(sourcefd, buf, sizeof(buf))) > 0 ) -- cgit v1.2.3