The content of batman_adv/iface_status ends with a newline. Thus register_interfaces has to make sure that it only compares the first line without the \n when comparing with the status string.
Signed-off-by: Sven Eckelmann sven@narfation.org --- vis/vis.c | 5 +++++ 1 file changed, 5 insertions(+)
diff --git a/vis/vis.c b/vis/vis.c index 4d494bc..7eab781 100644 --- a/vis/vis.c +++ b/vis/vis.c @@ -257,6 +257,7 @@ static int register_interfaces(struct globals *globals) DIR *iface_base_dir; struct dirent *iface_dir; char *path_buff, *file_content; + char *content_newline;
path_buff = malloc(PATH_BUFF_LEN); if (!path_buff) { @@ -295,6 +296,10 @@ static int register_interfaces(struct globals *globals) if (!file_content) continue;
+ content_newline = strstr(file_content, "\n"); + if (content_newline) + *content_newline = '\0'; + if (strcmp(file_content, "active") == 0) get_if_index(globals, iface_dir->d_name);