diff options
| author | 2011-06-13 21:50:31 +0100 | |
|---|---|---|
| committer | 2011-06-13 21:50:31 +0100 | |
| commit | eadf090413c530e69e8568492ebeb4b4087bd2ad (patch) | |
| tree | cce8671f1d59e40a0bdc0be6c9ef379812ff8010 /lsx.c | |
| parent | add lsx.1 (diff) | |
new dmenu_run
Diffstat (limited to '')
| -rw-r--r-- | lsx.c | 6 |
1 files changed, 2 insertions, 4 deletions
@@ -6,7 +6,7 @@ #include <unistd.h> #include <sys/stat.h> -static void lsx(const char *s); +static void lsx(const char *dir); int main(int argc, char *argv[]) { @@ -34,9 +34,7 @@ lsx(const char *dir) { } while((d = readdir(dp))) { snprintf(buf, sizeof buf, "%s/%s", dir, d->d_name); - if(stat(buf, &st) == -1) - perror(buf); - else if(S_ISREG(st.st_mode) && access(buf, X_OK) == 0) + if(stat(buf, &st) == 0 && S_ISREG(st.st_mode) && access(buf, X_OK) == 0) puts(d->d_name); } closedir(dp); |
