diff options
author | lostd <lostd@2f30.org> | 2014-10-23 00:31:45 +0300 |
---|---|---|
committer | lostd <lostd@2f30.org> | 2014-10-23 00:31:45 +0300 |
commit | a6060732964cf4e9212c9d69926b412b7a7b8fee (patch) | |
tree | fc33c819e47340577f9d68bd87dda3b8d2d2fa6f /noice.c | |
parent | 1c23cbc2ad07ae62c47ce1b091c86dd112c469f9 (diff) | |
download | noice-a6060732964cf4e9212c9d69926b412b7a7b8fee.tar.gz |
Try to open file to see access errors on the status bar
Diffstat (limited to 'noice.c')
-rw-r--r-- | noice.c | 8 |
1 files changed, 7 insertions, 1 deletions
@@ -569,7 +569,7 @@ browse(const char *ipath, const char *ifilter) DIR *dirp; struct entry *dents; int i, n, cur; - int r, ret; + int r, ret, fd; char *path = xrealpath(ipath); char *filter = xstrdup(ifilter); regex_t filter_re; @@ -683,6 +683,12 @@ nochange: DPRINTF_S(name); /* 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); if (r == -1) { printwarn(); |