From 6b888dbb6c6d9a630a2510cbb1fdfb037be903ee Mon Sep 17 00:00:00 2001 From: Martin Ziemer Date: Thu, 4 Apr 2024 15:33:14 +0200 Subject: [PATCH] Fix file creation on OpenBSD --- src/nnn.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/nnn.c b/src/nnn.c index 416e0ca83..0fb748330 100644 --- a/src/nnn.c +++ b/src/nnn.c @@ -4732,7 +4732,7 @@ static bool xmktree(char *path, bool dir) return FALSE; } } else { - int fd = open(path, O_CREAT | O_TRUNC, S_IWUSR | S_IRUSR); /* Forced create mode for files */ + int fd = open(path, O_WRONLY | O_CREAT | O_TRUNC, S_IWUSR | S_IRUSR); /* Forced create mode for files */ if (fd == -1 && errno != EEXIST) { DPRINTF_S("open!");