From: Steinar H. Gunderson Date: Sun, 29 May 2022 09:11:10 +0000 (+0200) Subject: Fix an issue where updatedb would stop on certain CIFS filesystems. X-Git-Tag: 1.1.16~1 X-Git-Url: https://git.sesse.net/?p=plocate;a=commitdiff_plain;h=7d6997bb1fb76289dc65cc9aecb200735e209f60 Fix an issue where updatedb would stop on certain CIFS filesystems. Reported by rollopack. --- diff --git a/updatedb.cpp b/updatedb.cpp index 188d3c2..e1320b3 100644 --- a/updatedb.cpp +++ b/updatedb.cpp @@ -610,8 +610,12 @@ int scan(const string &path, int fd, dev_t parent_dev, dir_time modified, dir_ti } else { dir = fdopendir(fd); // Takes over ownership of fd. if (dir == nullptr) { - perror("fdopendir"); - exit(1); + // fdopendir() wants to fstat() the fd to verify that it's indeed + // a directory, which can seemingly fail on at least CIFS filesystems + // if the server feels like it. We treat this as if we had an error + // on opening it, ie., ignore the directory. + close(fd); + return 0; } dirent *de;