summaryrefslogtreecommitdiffstats
path: root/mbbsd/edit.c
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/edit.c
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/edit.c')
-rw-r--r--mbbsd/edit.c9
1 files changed, 2 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);
}