[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] master f7228a6: Fix directory-files-and-attributes race

From: Paul Eggert
Subject: [Emacs-diffs] master f7228a6: Fix directory-files-and-attributes race
Date: Thu, 12 Sep 2019 02:23:27 -0400 (EDT)

branch: master
commit f7228a6479cc8c88a23138980d958c4c431dd6a5
Author: Paul Eggert <address@hidden>
Commit: Paul Eggert <address@hidden>

    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.
 src/dired.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/dired.c b/src/dired.c
index 7bc4b83..58fa848 100644
--- a/src/dired.c
+++ b/src/dired.c
@@ -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);

reply via email to

[Prev in Thread] Current Thread [Next in Thread]