diff options
author | piaip <piaip@63ad8ddf-47c3-0310-b6dd-a9e9d9715204> | 2011-10-28 23:25:01 +0800 |
---|---|---|
committer | piaip <piaip@63ad8ddf-47c3-0310-b6dd-a9e9d9715204> | 2011-10-28 23:25:01 +0800 |
commit | e5527de05b00b35c94aa421236fbfb5bc5d2e677 (patch) | |
tree | f61bda49321515299847a259f6f8a57778aba787 | |
parent | 8252a5aeeb7309418e68f4e0a79f5b85f21b92c0 (diff) | |
download | pttbbs-e5527de05b00b35c94aa421236fbfb5bc5d2e677.tar pttbbs-e5527de05b00b35c94aa421236fbfb5bc5d2e677.tar.gz pttbbs-e5527de05b00b35c94aa421236fbfb5bc5d2e677.tar.bz2 pttbbs-e5527de05b00b35c94aa421236fbfb5bc5d2e677.tar.lz pttbbs-e5527de05b00b35c94aa421236fbfb5bc5d2e677.tar.xz pttbbs-e5527de05b00b35c94aa421236fbfb5bc5d2e677.tar.zst pttbbs-e5527de05b00b35c94aa421236fbfb5bc5d2e677.zip |
improve error messages when file system is readonly
git-svn-id: http://opensvn.csie.org/pttbbs/trunk@5449 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
-rw-r--r-- | pttbbs/mbbsd/bbs.c | 13 | ||||
-rw-r--r-- | pttbbs/mbbsd/user.c | 5 |
2 files changed, 13 insertions, 5 deletions
diff --git a/pttbbs/mbbsd/bbs.c b/pttbbs/mbbsd/bbs.c index 796f239c..e46215c4 100644 --- a/pttbbs/mbbsd/bbs.c +++ b/pttbbs/mbbsd/bbs.c @@ -1293,7 +1293,10 @@ do_general(int garbage) /* build filename */ setbpath(fpath, currboard); - stampfile(fpath, &postfile); + if (stampfile(fpath, &postfile) < 0) { + vmsg("系統錯誤: 無法寫入檔案。"); + return FULLUPDATE; + } if(posttype!=-1 && ((1<<posttype) & bp->posttype_f)) { setbnfile(genbuf, bp->brdname, "postsample", posttype); Copy(genbuf, fpath); @@ -2090,7 +2093,10 @@ cross_post(int ent, fileheader_t * fhdr, const char *direct) currmode = 0; setbpath(xfpath, xboard); - stampfile(xfpath, &xfile); + if (stampfile(xfpath, &xfile) < 0) { + vmsg("系統錯誤: 無法寫入檔案"); + return FULLUPDATE; + } strlcpy(xfile.owner, cuser.userid, sizeof(xfile.owner)); strlcpy(xfile.title, xtitle, sizeof(xfile.title)); if (genbuf[0] == 'l') { @@ -2826,7 +2832,8 @@ do_add_recommend(const char *direct, fileheader_t *fhdr, close(fd); #endif } else { - vmsg("錯誤: 原檔案已被刪除。 無法寫入。"); + vmsg((errno == EROFS) ? "錯誤: 系統目前唯讀中,無法修改。" : + "錯誤: 原檔案已被刪除。 無法寫入。"); goto error; } diff --git a/pttbbs/mbbsd/user.c b/pttbbs/mbbsd/user.c index ed6272b9..e6550274 100644 --- a/pttbbs/mbbsd/user.c +++ b/pttbbs/mbbsd/user.c @@ -1140,11 +1140,12 @@ uinfo_query(const char *orig_uid, int adminmode, int unum) case '5': mvouts(b_lines - 3, 0, "已知很多使用者搞不清狀況改完 ID 大小寫會哭哭無法修改以前文章\n" - "請停止改大小寫的服務。\n"); + "且會有不少管理/維護上的問題,所以請停止改大小寫的服務。\n"); if (vans("你是要改大小寫嗎? [Y/n]") != 'n') { fail++; break; } + move(3, 0); clrtobot(); if (getdata_str(b_lines - 3, 0, "新的使用者代號:", genbuf, IDLEN + 1, DOECHO, x.userid)) { static char last_uid[IDLEN + 1]; @@ -1154,7 +1155,7 @@ uinfo_query(const char *orig_uid, int adminmode, int unum) vs_hdr(" ... 明明是改大小寫啊 ..."); prints("\n\n\t%s -> %s\n", last_uid, genbuf); outs("\t不是說好不改大小寫了嗎?\n" - "\t... 如果你真的打定主意要改,請重新登入吧\n"); + "\t... 如果你真的打定主意要改,請重新登入吧 ...\n"); fail++; break; } |