summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorpiaip <piaip@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2012-05-04 19:32:08 +0800
committerpiaip <piaip@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2012-05-04 19:32:08 +0800
commit5886d040cca372eea16e06b21b735716d593c9fa (patch)
tree8e8547a454c38ec7511ee45d9a0ce6c0727d26ac
parent8fc5a7628bb99dcae217faabbf0d45034a4147fc (diff)
downloadpttbbs-5886d040cca372eea16e06b21b735716d593c9fa.tar
pttbbs-5886d040cca372eea16e06b21b735716d593c9fa.tar.gz
pttbbs-5886d040cca372eea16e06b21b735716d593c9fa.tar.bz2
pttbbs-5886d040cca372eea16e06b21b735716d593c9fa.tar.lz
pttbbs-5886d040cca372eea16e06b21b735716d593c9fa.tar.xz
pttbbs-5886d040cca372eea16e06b21b735716d593c9fa.tar.zst
pttbbs-5886d040cca372eea16e06b21b735716d593c9fa.zip
Fix 'R' logic to prevent SubOP make mistake: #1FeNMiS1 (PttNewhand).
git-svn-id: http://opensvn.csie.org/pttbbs/trunk@5674 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
-rw-r--r--pttbbs/mbbsd/admin.c18
1 files changed, 16 insertions, 2 deletions
diff --git a/pttbbs/mbbsd/admin.c b/pttbbs/mbbsd/admin.c
index fdfc2f13..587971fb 100644
--- a/pttbbs/mbbsd/admin.c
+++ b/pttbbs/mbbsd/admin.c
@@ -835,11 +835,25 @@ m_newbrd(int whatclass, int recover)
strlcpy(newboard.title + 7, genbuf, sizeof(newboard.title) - 7);
setbpath(genbuf, newboard.brdname);
- if (!recover &&
- (getbnum(newboard.brdname) > 0 || Mkdir(genbuf) == -1)) {
+ // Recover ���u���ӳB�z�ؿ��w�s�b(��.BRD�S��)�����p�A���M�N�|�b
+ // ���H�~�ήɳy���P�ӥؿ����h�� board entry �����ΡC
+ // getbnum(newboard.brdname) > 0 �ɥѩ�ثe�]�p�O�| new board,
+ // �ҥH�u���}�O��u�|�y�� bcache ���áA���i���V�C
+ if (getbnum(newboard.brdname) > 0) {
vmsg("���ݪO�w�g�s�b! �Ш����P�^��O�W");
return -1;
}
+ if (Mkdir(genbuf) != 0) {
+ if (errno == EEXIST) {
+ if (!recover) {
+ vmsg("�ݪO�ؿ��w�s�b�A�Y�O�n�״_�ݪO�Х� R ���O�C");
+ return -1;
+ }
+ } else {
+ vmsgf("�t�ο��~ #%d, �L�k�إ߬ݪO�ؿ��C", errno);
+ return -1;
+ }
+ }
newboard.brdattr = BRD_NOTRAN;
#ifdef DEFAULT_AUTOCPLOG
newboard.brdattr |= BRD_CPLOG;