[hackers] [slstatus] swap: OS split || Quentin Rameau

From: <git_AT_suckless.org>
Date: Mon, 30 Apr 2018 15:44:42 +0200 (CEST)

commit 72f5a0d69ad43e7329064f415b4f8df3c1c2ccec
Author: Quentin Rameau <quinq_AT_fifth.space>
AuthorDate: Mon Apr 30 15:14:36 2018 +0200
Commit: Aaron Marcher <me_AT_drkhsh.at>
CommitDate: Mon Apr 30 15:41:52 2018 +0200

    swap: OS split

diff --git a/Makefile b/Makefile
index 99d10c5..5dcef0f 100644
--- a/Makefile
+++ b/Makefile
_AT_@ -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\
diff --git a/components/swap.c b/components/Linux/swap.c
similarity index 98%
rename from components/swap.c
rename to components/Linux/swap.c
index f3bbeb2..bce9d5a 100644
--- a/components/swap.c
+++ b/components/Linux/swap.c
_AT_@ -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)
_AT_@ -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
index 0000000..e69de29
Received on Mon Apr 30 2018 - 15:44:42 CEST

This archive was generated by hypermail 2.3.0 : Mon Apr 30 2018 - 15:49:04 CEST