diff options
| author | Marc André Tanner <mat@brain-dump.org> | 2017-03-22 13:07:18 +0100 |
|---|---|---|
| committer | Marc André Tanner <mat@brain-dump.org> | 2017-03-22 13:15:11 +0100 |
| commit | c9a259bbe118d60558a8891e0bd701e8fb0ba91d (patch) | |
| tree | 5bce618a981ded8b0324a60e49f6d0efea3b0883 | |
| parent | d9928d0d5e2015a3a41ae730549ecf8638205958 (diff) | |
| download | vis-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.c | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -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; |
