Add check for empty tracefs mounts

pull/557/head
drewvis 2 years ago
parent 8ef00c4c63
commit 3a2c0cd1dd

@ -33,7 +33,8 @@ pub(crate) fn find_tracefs_path() -> Result<&'static Path, ProgramError> {
]; ];
for mount in known_mounts { for mount in known_mounts {
if mount.exists() { // Check that the mount point exists and is not empty
if mount.exists() && mount.read_dir().ok()?.next().is_some() {
return Some(mount); return Some(mount);
} }
} }

Loading…
Cancel
Save