Commit f7228a64 authored by Paul Eggert's avatar Paul Eggert

Fix directory-files-and-attributes race

* src/dired.c (directory_files_internal): Fix race condition:
when some other process removed a file between the readdir and
the ensuing lstat, directory-files-and-attributes would return
a list containing nil.
parent ef926ce3
Pipeline #3103 failed with stage
in 57 minutes and 22 seconds
......@@ -295,7 +295,8 @@ directory_files_internal (Lisp_Object directory, Lisp_Object full,
Lisp_Object fileattrs
= file_attributes (fd, dp->d_name, directory, name, id_format);
list = Fcons (Fcons (finalname, fileattrs), list);
if (!NILP (fileattrs))
list = Fcons (Fcons (finalname, fileattrs), list);
list = Fcons (finalname, list);
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment