diff options
author | in2 <in2@63ad8ddf-47c3-0310-b6dd-a9e9d9715204> | 2002-04-19 20:10:09 +0800 |
---|---|---|
committer | in2 <in2@63ad8ddf-47c3-0310-b6dd-a9e9d9715204> | 2002-04-19 20:10:09 +0800 |
commit | 67afb777945003a7ca2bedd2c301a8a1f62fc589 (patch) | |
tree | 51bb5c667faf3ffec1acbd7d47cf70a3bbe60297 /mbbsd | |
parent | 6cf8bad17c7cea15f9034fff8609d90ad67723a4 (diff) | |
download | pttbbs-67afb777945003a7ca2bedd2c301a8a1f62fc589.tar pttbbs-67afb777945003a7ca2bedd2c301a8a1f62fc589.tar.gz pttbbs-67afb777945003a7ca2bedd2c301a8a1f62fc589.tar.bz2 pttbbs-67afb777945003a7ca2bedd2c301a8a1f62fc589.tar.lz pttbbs-67afb777945003a7ca2bedd2c301a8a1f62fc589.tar.xz pttbbs-67afb777945003a7ca2bedd2c301a8a1f62fc589.tar.zst pttbbs-67afb777945003a7ca2bedd2c301a8a1f62fc589.zip |
fix bug(MDCACHE)
git-svn-id: http://opensvn.csie.org/pttbbs/pttbbs/trunk/pttbbs@124 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
Diffstat (limited to 'mbbsd')
-rw-r--r-- | mbbsd/cache.c | 4 |
1 files changed, 2 insertions, 2 deletions
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 <stdio.h> #include <stdlib.h> #include <string.h> @@ -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 ) |