Browse Source

Try to open file to see access errors on the status bar

master
lostd 10 years ago
parent
commit
a606073296
1 changed files with 7 additions and 1 deletions
  1. +7
    -1
      noice.c

+ 7
- 1
noice.c View File

@@ -569,7 +569,7 @@ browse(const char *ipath, const char *ifilter)
DIR *dirp; DIR *dirp;
struct entry *dents; struct entry *dents;
int i, n, cur; int i, n, cur;
int r, ret; int r, ret, fd;
char *path = xrealpath(ipath); char *path = xrealpath(ipath);
char *filter = xstrdup(ifilter); char *filter = xstrdup(ifilter);
regex_t filter_re; regex_t filter_re;
@@ -683,6 +683,12 @@ nochange:
DPRINTF_S(name); DPRINTF_S(name);


/* Get path info */ /* Get path info */
fd = openat(dirfd(dirp), name, O_RDONLY | O_NONBLOCK);
if (fd == -1) {
printwarn();
goto nochange;
}
close(fd);
r = fstatat(dirfd(dirp), name, &sb, 0); r = fstatat(dirfd(dirp), name, &sb, 0);
if (r == -1) { if (r == -1) {
printwarn(); printwarn();


||||||
x
 
000:0
Loading…
Cancel
Save