summaryrefslogtreecommitdiffstats
path: root/mbbsd/bbs.c
diff options
context:
space:
mode:
authorpiaip <piaip@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2008-01-10 00:11:05 +0800
committerpiaip <piaip@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2008-01-10 00:11:05 +0800
commit603d2ded05450918e5cd857a4379c4715a76ba43 (patch)
treee68918009a82031ca4c8a463f944996bdbe541d0 /mbbsd/bbs.c
parent7b794f4dfbfe35135fffc78ed5187bbfa5ac1436 (diff)
downloadpttbbs-603d2ded05450918e5cd857a4379c4715a76ba43.tar
pttbbs-603d2ded05450918e5cd857a4379c4715a76ba43.tar.gz
pttbbs-603d2ded05450918e5cd857a4379c4715a76ba43.tar.bz2
pttbbs-603d2ded05450918e5cd857a4379c4715a76ba43.tar.lz
pttbbs-603d2ded05450918e5cd857a4379c4715a76ba43.tar.xz
pttbbs-603d2ded05450918e5cd857a4379c4715a76ba43.tar.zst
pttbbs-603d2ded05450918e5cd857a4379c4715a76ba43.zip
- mmbsd: improve DEBUGSLEEP proctitle for debugging multiple versions
- bbs: try to prevent mmap SEGV issue (caused by mv(1) truncating ?) - pmore: change back to MAP_SHARED, and try MAP_POPULATE git-svn-id: http://opensvn.csie.org/pttbbs/trunk/pttbbs@3810 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
Diffstat (limited to 'mbbsd/bbs.c')
-rw-r--r--mbbsd/bbs.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/mbbsd/bbs.c b/mbbsd/bbs.c
index 31d74a62..87b6f140 100644
--- a/mbbsd/bbs.c
+++ b/mbbsd/bbs.c
@@ -1560,8 +1560,13 @@ edit_post(int ent, fileheader_t * fhdr, const char *direct)
// OK to save file.
- // force to remove file first?
- // unlink(genbuf);
+ // piaip Wed Jan 9 11:11:33 CST 2008
+ // in order to prevent calling system 'mv' all the
+ // time, it is better to unlink() first, which
+ // increased the chance of succesfully using rename().
+ // WARNING: if genbuf and fpath are in different directory,
+ // you should disable pre-unlinking
+ unlink(genbuf);
Rename(fpath, genbuf);
fhdr->modified = dasht(genbuf);