From eca797d04cd68d2ec7b8e0abde0f71ac897c2066 Mon Sep 17 00:00:00 2001 From: "Steinar H. Gunderson" Date: Thu, 23 Sep 2021 19:54:51 +0200 Subject: [PATCH] Support kernels that don't know about O_TMPFILE. Seemingly, this hit WSL1, making it impossible to run updatedb there. --- database-builder.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/database-builder.cpp b/database-builder.cpp index 9855858..419e012 100644 --- a/database-builder.cpp +++ b/database-builder.cpp @@ -490,7 +490,7 @@ DatabaseBuilder::DatabaseBuilder(const char *outfile, gid_t owner, int block_siz int fd = -1; #ifdef O_TMPFILE fd = open(path.c_str(), O_WRONLY | O_TMPFILE, 0640); - if (fd == -1 && errno != EOPNOTSUPP) { + if (fd == -1 && errno != EOPNOTSUPP && errno != EISDIR) { perror(path.c_str()); exit(1); } -- 2.39.2