X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=updatedb.cpp;h=e1320b3e1ef58affd7dda61f7486921589754f8f;hb=fd6198891d6fd9642effc0843fef6f23b991af3e;hp=188d3c2113f08c7ecd2de6045d9f6694782e6625;hpb=e734063cbdc5064e215dab677988f5558de2a058;p=plocate 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;