- if (!(fd = opendir(dir))) {
- fprintf(stderr, "opendir '%s': %s\n", dir, strerror(errno));
+ if (!(fd = opendir(path))) {
+ warn("opendir '%s':", path);
while ((dp = readdir(fd))) {
if (!strcmp(dp->d_name, ".") || !strcmp(dp->d_name, "..")) {
continue; /* skip self and parent */
while ((dp = readdir(fd))) {
if (!strcmp(dp->d_name, ".") || !strcmp(dp->d_name, "..")) {
continue; /* skip self and parent */