From 3721463eb3bc5968554be363e9c64448aa097bab Mon Sep 17 00:00:00 2001 From: Thad House Date: Wed, 19 Dec 2018 14:40:01 -0800 Subject: [PATCH] Don't use symbolic path searching for USB detection (#1491) The USB directories we care about are not symbolic links, so we can ignore them. There was a recursive symbolic link, which was causing failure. --- hal/src/main/native/athena/cpp/SerialHelper.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/hal/src/main/native/athena/cpp/SerialHelper.cpp b/hal/src/main/native/athena/cpp/SerialHelper.cpp index 389cdbef76..98b22db7e0 100644 --- a/hal/src/main/native/athena/cpp/SerialHelper.cpp +++ b/hal/src/main/native/athena/cpp/SerialHelper.cpp @@ -215,9 +215,11 @@ void SerialHelper::QueryHubPaths(int32_t* status) { if (matchString.equals(devNameRef)) continue; // Search directories to get a list of system accessors + // The directories we need are not symbolic, so we can safely + // disable symbolic links. std::error_code ec; for (auto p = wpi::sys::fs::recursive_directory_iterator( - "/sys/devices/soc0", ec); + "/sys/devices/soc0", ec, false); p != wpi::sys::fs::recursive_directory_iterator(); p.increment(ec)) { if (ec) break; wpi::StringRef path{p->path()};