]> git.sesse.net Git - plocate/commitdiff
Support kernels that don't know about O_TMPFILE.
authorSteinar H. Gunderson <steinar+git@gunderson.no>
Thu, 23 Sep 2021 17:54:51 +0000 (19:54 +0200)
committerSteinar H. Gunderson <steinar+git@gunderson.no>
Thu, 23 Sep 2021 17:54:51 +0000 (19:54 +0200)
Seemingly, this hit WSL1, making it impossible to run updatedb there.

database-builder.cpp

index 985585838308fc7518a148c4d5473a14cdc79968..419e012ca94c2625471680de17b67f07716ecec8 100644 (file)
@@ -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);
        }