If we can open it and read it, it's good enough for us. Otherwise, we
cannot use -C /dev/null to skip the system configuration for instance:
$ ./tools/modprobe -C /dev/null -c
libkmod: ERROR libkmod/libkmod-config.c:821 conf_files_list: unsupported
file mode /dev/null: 0x21b6
...
*path_stamp = stat_mstamp(&st);
- if (S_ISREG(st.st_mode)) {
+ if (!S_ISDIR(st.st_mode)) {
conf_files_insert_sorted(ctx, list, path, NULL);
return 0;
- } else if (!S_ISDIR(st.st_mode)) {
- ERR(ctx, "unsupported file mode %s: %#x\n",
- path, st.st_mode);
- return -EINVAL;
}
d = opendir(path);
return err;
}
- if (S_ISREG(st.st_mode)) {
+ if (!S_ISDIR(st.st_mode)) {
cfg_files_insert_sorted(p_files, p_n_files, path, NULL);
return 0;
- } else if (!S_ISDIR(st.st_mode)) {
- ERR("unsupported file mode %s: %#x\n", path, st.st_mode);
- return -EINVAL;
}
d = opendir(path);