Commit Diff
Diff:
09223daf13957e0fe22ace0f6a2f5a96f8b16344
58b2f322e4e3360e8d7e1fd892842d891fdba186
Commit:
58b2f322e4e3360e8d7e1fd892842d891fdba186
Tree:
04f9f90a598b261770b0e28418780117385e07e3
Author:
Omar Polo <op@omarpolo.com>
Date:
Sat Jun 11 07:57:14 2022 UTC
Message:
skip every non-regular file

not only directories... I guess we can't do much even with sockets,
fifos or character devices. (symbolic links are still supported since
we follow them)
commit - 09223daf13957e0fe22ace0f6a2f5a96f8b16344
commit + 58b2f322e4e3360e8d7e1fd892842d891fdba186
blob - 41b25022fe9b12ed0d583dee140ffe81835a3f7f
blob + 1ef3fdea14435e796b7acd3ca89c2250582878d2
--- amused.c
+++ amused.c
@@ -375,8 +375,8 @@ main_play_song(const char *path)
return 0;
}
- if (S_ISDIR(sb.st_mode)) {
- log_info("skipping a directory: %s", path);
+ if (!S_ISREG(sb.st_mode)) {
+ log_info("skipping non-regular file: %s", path);
close(fd);
return 0;
}
Omar Polo