aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/nnn.c11
1 files changed, 2 insertions, 9 deletions
diff --git a/src/nnn.c b/src/nnn.c
index e5f0d00..c06ce17 100644
--- a/src/nnn.c
+++ b/src/nnn.c
@@ -2650,18 +2650,11 @@ nochange:
mkpath(path, dents[cur].name, newpath, PATH_MAX);
DPRINTF_S(newpath);
- /* Get path info */
- fd = open(newpath, O_RDONLY | O_NONBLOCK);
- if (fd == -1) {
- printwarn();
- goto nochange;
- }
- if (fstat(fd, &sb) == -1) {
+ /* Cannot use stale data in entry, file may be missing by now */
+ if (stat(newpath, &sb) == -1) {
printwarn();
- close(fd);
goto nochange;
}
- close(fd);
DPRINTF_U(sb.st_mode);
switch (sb.st_mode & S_IFMT) {