Log error reason if we fail to detect interface type from reading /sys/net

This commit is contained in:
Jeremy Lakeman 2017-11-20 15:05:36 +10:30
parent 577fbb34db
commit bb7d95ccd1

View File

@ -1121,6 +1121,7 @@ overlay_interface_register(const char *name,
// This interface has a symlink to a physical wifi device
detected_type = OVERLAY_INTERFACE_WIFI;
}else{
WARNF_perror("stat(%s)", path);
strbuf_reset(sb);
strbuf_sprintf(sb, "/sys/class/net/%s/speed", name);
int fd = open(path, O_RDONLY);
@ -1129,6 +1130,8 @@ overlay_interface_register(const char *name,
// we *could* read this file to set config based on link speed
detected_type = OVERLAY_INTERFACE_ETHERNET;
close(fd);
}else{
WARNF_perror("open(%s)", path);
}
}
#endif