File tree Expand file tree Collapse file tree 1 file changed +10
-4
lines changed Expand file tree Collapse file tree 1 file changed +10
-4
lines changed Original file line number Diff line number Diff line change @@ -115,27 +115,33 @@ static void read_config_file(const char *path)
115
115
116
116
static void read_config (void )
117
117
{
118
+ char * verbs_config_dir ;
118
119
DIR * conf_dir ;
119
120
struct dirent * dent ;
120
121
char * path ;
121
122
122
- conf_dir = opendir (IBV_CONFIG_DIR );
123
+ verbs_config_dir = getenv ("VERBS_CONFIG_DIR" );
124
+ if (!verbs_config_dir ) {
125
+ verbs_config_dir = IBV_CONFIG_DIR ;
126
+ }
127
+
128
+ conf_dir = opendir (verbs_config_dir );
123
129
if (!conf_dir ) {
124
130
fprintf (stderr ,
125
131
PFX "Warning: couldn't open config directory '%s'.\n" ,
126
- IBV_CONFIG_DIR );
132
+ verbs_config_dir );
127
133
return ;
128
134
}
129
135
130
136
while ((dent = readdir (conf_dir ))) {
131
137
struct stat buf ;
132
138
133
- if (asprintf (& path , "%s/%s" , IBV_CONFIG_DIR , dent -> d_name ) <
139
+ if (asprintf (& path , "%s/%s" , verbs_config_dir , dent -> d_name ) <
134
140
0 ) {
135
141
fprintf (stderr ,
136
142
PFX
137
143
"Warning: couldn't read config file %s/%s.\n" ,
138
- IBV_CONFIG_DIR , dent -> d_name );
144
+ verbs_config_dir , dent -> d_name );
139
145
goto out ;
140
146
}
141
147
You can’t perform that action at this time.
0 commit comments