Message ID | 51be8e667556fbbed2e68d1041890bd1372325a0.1375952089.git.ydroneaud@opteya.com (mailing list archive) |
---|---|
State | Rejected |
Headers | show |
diff --git a/src/init.c b/src/init.c index 8e93f3f..ce9e1c0 100644 --- a/src/init.c +++ b/src/init.c @@ -306,6 +306,9 @@ static void read_config(void) while ((dent = readdir(conf_dir))) { struct stat buf; + if (dent->d_name[0] == '.') + continue; + if (asprintf(&path, "%s/%s", IBV_CONFIG_DIR, dent->d_name) < 0) { fprintf(stderr, PFX "Warning: couldn't read config file %s/%s.\n", IBV_CONFIG_DIR, dent->d_name);
Files beginning with a dot '.' are likely the current and parent directories, or, hidden files ignored by 'ls'. Those paths are already skipped in find_sysfs_dev() they should probably be skipped here too. Signed-off-by: Yann Droneaud <ydroneaud@opteya.com> --- src/init.c | 3 +++ 1 file changed, 3 insertions(+)