Skip to content
Snippets Groups Projects
Commit 7c1b2318 authored by Georges Da Costa's avatar Georges Da Costa
Browse files

Corrects the crash if -i and no infiniband present

parent fcf6676b
No related branches found
No related tags found
No related merge requests found
......@@ -33,7 +33,8 @@ char **init_infiniband(char* infi_path) {
glob_t res;
glob("/sys/class/infiniband/*/ports/*/counters/", 0, NULL, &res);
if(res.gl_pathc == 0)
return NULL;
infi_path = res.gl_pathv[0];
}
......
......@@ -197,6 +197,8 @@ int main(int argc, char **argv) {
char ** infiniband_sources = NULL;
if(infi_path != NULL)
infiniband_sources = init_infiniband(infi_path);
if(infiniband_sources == NULL)
infi_path = NULL;
long long infiniband_values[4]={0,0,0,0};
long long tmp_infiniband_values[4]={0,0,0,0};
get_network(infiniband_values, infiniband_sources);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment