From: Steinar H. Gunderson Date: Thu, 23 Sep 2021 17:54:51 +0000 (+0200) Subject: Support kernels that don't know about O_TMPFILE. X-Git-Tag: 1.1.12~2 X-Git-Url: https://git.sesse.net/?a=commitdiff_plain;h=eca797d04cd68d2ec7b8e0abde0f71ac897c2066;p=plocate Support kernels that don't know about O_TMPFILE. Seemingly, this hit WSL1, making it impossible to run updatedb there. --- 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); }