mirror of https://github.com/aristocratos/btop.git
Added try->catch for get_zfs_stat_file() to avoid fs error
This commit is contained in:
parent
6282f36f8f
commit
e770cccaf8
|
@ -1936,6 +1936,7 @@ namespace Mem {
|
||||||
}
|
}
|
||||||
|
|
||||||
// looking through all files that start with 'objset' to find the one containing `device_name` object stats
|
// looking through all files that start with 'objset' to find the one containing `device_name` object stats
|
||||||
|
try {
|
||||||
for (const auto& file: fs::directory_iterator(zfs_pool_stat_path)) {
|
for (const auto& file: fs::directory_iterator(zfs_pool_stat_path)) {
|
||||||
filename = file.path().filename();
|
filename = file.path().filename();
|
||||||
if (filename.starts_with("objset")) {
|
if (filename.starts_with("objset")) {
|
||||||
|
@ -1959,6 +1960,8 @@ namespace Mem {
|
||||||
filestream.close();
|
filestream.close();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
catch (fs::filesystem_error& e) {}
|
||||||
|
|
||||||
Logger::debug("Could not read directory: " + zfs_pool_stat_path.string());
|
Logger::debug("Could not read directory: " + zfs_pool_stat_path.string());
|
||||||
return "";
|
return "";
|
||||||
|
|
Loading…
Reference in New Issue