summaryrefslogtreecommitdiffstats
path: root/mbbsd
diff options
context:
space:
mode:
authorvictor <victor@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2004-05-19 00:03:33 +0800
committervictor <victor@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2004-05-19 00:03:33 +0800
commitf187c64d03772ebafd67b497080db42b508b66cf (patch)
tree1dfaa8e570eeff691f5fce340e68767a742d9303 /mbbsd
parent13601c52fd1e9b6784a5776c0f7bdd0b9f91524b (diff)
downloadpttbbs-f187c64d03772ebafd67b497080db42b508b66cf.tar
pttbbs-f187c64d03772ebafd67b497080db42b508b66cf.tar.gz
pttbbs-f187c64d03772ebafd67b497080db42b508b66cf.tar.bz2
pttbbs-f187c64d03772ebafd67b497080db42b508b66cf.tar.lz
pttbbs-f187c64d03772ebafd67b497080db42b508b66cf.tar.xz
pttbbs-f187c64d03772ebafd67b497080db42b508b66cf.tar.zst
pttbbs-f187c64d03772ebafd67b497080db42b508b66cf.zip
edit.c: just need to fopen
talk.c: fix broken fd after canceling the request git-svn-id: http://opensvn.csie.org/pttbbs/trunk/pttbbs@2003 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
Diffstat (limited to 'mbbsd')
-rw-r--r--mbbsd/edit.c9
-rw-r--r--mbbsd/talk.c4
2 files changed, 6 insertions, 7 deletions
diff --git a/mbbsd/edit.c b/mbbsd/edit.c
index d8f376fc..6b8d900e 100644
--- a/mbbsd/edit.c
+++ b/mbbsd/edit.c
@@ -999,18 +999,13 @@ write_file(char *fpath, int saveheader, int *islocal)
}
if (!aborted) {
- int tempfd;
if (saveheader && !(curredit & EDIT_MAIL) && check_quote())
return KEEP_EDITING;
- if (*fpath) {
- tempfd = open(fpath, O_WRONLY | O_CREAT | O_TRUNC, 0600);
- }else{
+ if (!(*fpath))
setuserfile(fpath, "ve_XXXXXX");
- tempfd = mkstemp(fpath);
- }
- if ((fp = fdopen(tempfd, "w")) == NULL) {
+ if ((fp = fopen(fpath, "w")) == NULL) {
indigestion(5);
abort_bbs(0);
}
diff --git a/mbbsd/talk.c b/mbbsd/talk.c
index 2fadd2de..6864faf9 100644
--- a/mbbsd/talk.c
+++ b/mbbsd/talk.c
@@ -2636,6 +2636,10 @@ talkreply(void)
page_requestor, sig_des[sig]);
getdata(0, 0, genbuf, buf, sizeof(buf), LCECHO);
a = reply_connection_request(uip);
+ if (a < 0) {
+ clear();
+ return;
+ }
if (!buf[0] || !strchr("yabcdef12", buf[0]))
buf[0] = 'n';