]> Skullheadx's Git Forge - slstatus.git/commitdiff
swap: OS split
authorQuentin Rameau <quinq@fifth.space>
Mon, 30 Apr 2018 13:14:36 +0000 (15:14 +0200)
committerAaron Marcher <me@drkhsh.at>
Mon, 30 Apr 2018 13:41:52 +0000 (15:41 +0200)
Makefile
components/Linux/swap.c [moved from components/swap.c with 98% similarity]
components/OpenBSD/swap.c [new file with mode: 0644]

index 99d10c576cf4321be41e2886aeff59a8b9e6a2d0..5dcef0f76480ef5da184ed06631395729c6671e3 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -20,7 +20,7 @@ COM =\
        components/num_files\
        components/$(OS)/ram \
        components/run_command\
-       components/swap\
+       components/$(OS)/swap \
        components/temperature\
        components/uptime\
        components/user\
similarity index 98%
rename from components/swap.c
rename to components/Linux/swap.c
index f3bbeb2337ea808943508fa7cfabaf5b5e40bb64..bce9d5ac2bf04e95b21689b9fcf680e23b8dc496 100644 (file)
@@ -1,10 +1,9 @@
 /* See LICENSE file for copyright and license details. */
-#if defined(__linux__)
 #include <errno.h>
 #include <stdio.h>
 #include <string.h>
 
-#include "../util.h"
+#include "../../util.h"
 
 const char *
 swap_free(void)
@@ -135,4 +134,3 @@ swap_used(void)
 
        return bprintf("%f", (float)(total - free - cached) / 1024 / 1024);
 }
-#endif
diff --git a/components/OpenBSD/swap.c b/components/OpenBSD/swap.c
new file mode 100644 (file)
index 0000000..e69de29