fix Linux storage reporting

This commit is contained in:
deepend committed 2026-12-04 18:26:41 -06:00
1 parent 4db044814c
commit 594e997a0d
4 files changed
+306 -32

No files matched your search

-31
View File
@@ -789,37 +789,6 @@ sysinfo_backend_get_memory (void)
return memory;
}
char *
sysinfo_backend_get_disk (void)
{
const char *path;
struct statvfs fs;
guint64 block_size;
guint64 total;
guint64 available;
char *usage;
/* Flatpak's home itself can be tmpfs; its data directory is persistent
* storage on the host filesystem that actually holds the app's data. */
path = g_file_test ("/.flatpak-info", G_FILE_TEST_IS_REGULAR)
? g_get_user_data_dir () : g_get_home_dir ();
if (!path || path[0] == '\0')
{
path = "/";
}
if (statvfs (path, &fs) != 0)
{
return NULL;
}
block_size = fs.f_frsize != 0 ? (guint64) fs.f_frsize : (guint64) fs.f_bsize;
total = (guint64) fs.f_blocks * block_size;
available = (guint64) fs.f_bavail * block_size;
usage = format_usage (total, available);
return usage;
}
char *
sysinfo_backend_get_uptime (void)
{