[hackers] [PATCH 4/9] entropy: OS split

From: Quentin Rameau <quinq_AT_fifth.space>
Date: Mon, 30 Apr 2018 15:14:34 +0200

---
 Makefile                         | 2 +-
 components/{ => Linux}/entropy.c | 4 +---
 components/OpenBSD/entropy.c     | 0
 3 files changed, 2 insertions(+), 4 deletions(-)
 rename components/{ => Linux}/entropy.c (82%)
 create mode 100644 components/OpenBSD/entropy.c
diff --git a/Makefile b/Makefile
index dee5a4b..bbb18a9 100644
--- a/Makefile
+++ b/Makefile
_AT_@ -11,7 +11,7 @@ COM =\
 	components/$(OS)/cpu \
 	components/datetime\
 	components/disk\
-	components/entropy\
+	components/$(OS)/entropy \
 	components/hostname\
 	components/ip\
 	components/kernel_release\
diff --git a/components/entropy.c b/components/Linux/entropy.c
similarity index 82%
rename from components/entropy.c
rename to components/Linux/entropy.c
index 65c65a1..17be270 100644
--- a/components/entropy.c
+++ b/components/Linux/entropy.c
_AT_@ -1,8 +1,7 @@
 /* See LICENSE file for copyright and license details. */
-#if defined(__linux__)
 #include <stdio.h>
 
-#include "../util.h"
+#include "../../util.h"
 
 const char *
 entropy(void)
_AT_@ -12,4 +11,3 @@ entropy(void)
 	return (pscanf("/proc/sys/kernel/random/entropy_avail", "%d", &num) == 1) ?
 	               bprintf("%d", num) : NULL;
 }
-#endif
diff --git a/components/OpenBSD/entropy.c b/components/OpenBSD/entropy.c
new file mode 100644
index 0000000..e69de29
-- 
2.16.2
Received on Mon Apr 30 2018 - 15:14:34 CEST

This archive was generated by hypermail 2.3.0 : Mon Apr 30 2018 - 15:25:02 CEST