From c9a259bbe118d60558a8891e0bd701e8fb0ba91d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc=20Andr=C3=A9=20Tanner?= Date: Wed, 22 Mar 2017 13:07:18 +0100 Subject: text: use proper open(2) flags when saving inplace This was wrongly changed in commit 74085e92c095d0bf4b98e262cc07ccf9b7dfff3b. --- text.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'text.c') 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; -- cgit v1.2.3