summary refs log tree commit diff stats
path: root/plugins/sysinfo/unix/backend.c
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/sysinfo/unix/backend.c')
-rw-r--r--plugins/sysinfo/unix/backend.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/plugins/sysinfo/unix/backend.c b/plugins/sysinfo/unix/backend.c
index 9d886f09..b6876452 100644
--- a/plugins/sysinfo/unix/backend.c
+++ b/plugins/sysinfo/unix/backend.c
@@ -60,14 +60,14 @@ char *sysinfo_backend_get_memory(void)
 	{
 		return NULL;
 	}
-	if (xs_parse_meminfo (&swap_total, &swap_free, 1) != 1)
+	if (xs_parse_meminfo (&swap_total, &swap_free, 1) != 1 && swap_total != 0)
 	{
 		swap_fmt = sysinfo_format_memory (swap_total, swap_free);
 	}
 
 	mem_fmt = sysinfo_format_memory (mem_total, mem_free);
 
-	if (swap_fmt && swap_total != 0)
+	if (swap_fmt)
 	{
 		ret = g_strdup_printf ("Physical: %s Swap: %s", mem_fmt, swap_fmt);
 		g_free (mem_fmt);