aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarc André Tanner <mat@brain-dump.org>2017-03-22 13:07:18 +0100
committerMarc André Tanner <mat@brain-dump.org>2017-03-22 13:15:11 +0100
commitc9a259bbe118d60558a8891e0bd701e8fb0ba91d (patch)
tree5bce618a981ded8b0324a60e49f6d0efea3b0883
parentd9928d0d5e2015a3a41ae730549ecf8638205958 (diff)
downloadvis-c9a259bbe118d60558a8891e0bd701e8fb0ba91d.tar.gz
vis-c9a259bbe118d60558a8891e0bd701e8fb0ba91d.tar.xz
text: use proper open(2) flags when saving inplace
This was wrongly changed in commit 74085e92c095d0bf4b98e262cc07ccf9b7dfff3b.
-rw-r--r--text.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/text.c b/text.c
index 59af7a1..d424cad 100644
--- a/text.c
+++ b/text.c
@@ -924,7 +924,7 @@ static bool text_save_begin_inplace(TextSave *ctx) {
Text *txt = ctx->txt;
struct stat meta = { 0 };
int newfd = -1, saved_errno;
- if ((ctx->fd = open(ctx->filename, 0666, S_IRUSR|S_IWUSR)) == -1)
+ if ((ctx->fd = open(ctx->filename, O_CREAT|O_WRONLY, 0666)) == -1)
goto err;
if (fstat(ctx->fd, &meta) == -1)
goto err;