diff mbox

[libibverbs,v2,01/11] read_config(): ignore files beginning with '.'

Message ID 51be8e667556fbbed2e68d1041890bd1372325a0.1375952089.git.ydroneaud@opteya.com (mailing list archive)
State Rejected
Headers show

Commit Message

Yann Droneaud Aug. 8, 2013, 7:40 p.m. UTC
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(+)
diff mbox

Patch

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);