提交 6089dcba 编写于 作者: R Rajan 提交者: Matteo Merli

Check symbolicLink file type before reading it as SymbolicLink file (#121)

上级 a7e746dc
......@@ -159,7 +159,8 @@ public class LinuxBrokerHostUsageImpl implements BrokerHostUsage {
private boolean isPhysicalNic(Path path) {
try {
if (!Files.readSymbolicLink(path).toString().contains("/virtual/")) {
path = Files.isSymbolicLink(path) ? Files.readSymbolicLink(path) : path;
if (!path.toString().contains("/virtual/")) {
try {
Files.readAllBytes(path.resolve("speed"));
return true;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册