X-Git-Url: https://git.xinqibao.xyz/slstatus.git/blobdiff_plain/0a287616b2e3122a1b149e28d63560819bcdf7c9..d518472e6235dde0164115cd68f383f3db3427f2:/components/num_files.c diff --git a/components/num_files.c b/components/num_files.c index 327a64d..fb55df9 100644 --- a/components/num_files.c +++ b/components/num_files.c @@ -1,20 +1,19 @@ /* See LICENSE file for copyright and license details. */ #include -#include #include #include #include "../util.h" const char * -num_files(const char *dir) +num_files(const char *path) { struct dirent *dp; DIR *fd; int num; - if (!(fd = opendir(dir))) { - fprintf(stderr, "opendir '%s': %s\n", dir, strerror(errno)); + if (!(fd = opendir(path))) { + warn("opendir '%s':", path); return NULL; }