SpaceAnalyzer: Replace fprintf(stderr) with warnln()

This commit is contained in:
Linus Groh 2021-05-30 19:25:04 +01:00
parent 8625f089bf
commit a6248101e2
Notes: sideshowbarker 2024-07-18 17:06:23 +09:00

View file

@ -75,13 +75,13 @@ struct MountInfo {
static void fill_mounts(Vector<MountInfo>& output)
{
// Output info about currently mounted filesystems.
auto df = Core::File::construct("/proc/df");
if (!df->open(Core::OpenMode::ReadOnly)) {
fprintf(stderr, "Failed to open /proc/df: %s\n", df->error_string());
auto file = Core::File::construct("/proc/df");
if (!file->open(Core::OpenMode::ReadOnly)) {
warnln("Failed to open {}: {}", file->name(), file->error_string());
return;
}
auto content = df->read_all();
auto content = file->read_all();
auto json = JsonValue::from_string(content);
VERIFY(json.has_value());