hc
2023-11-06 15ade055295d13f95d49e3d99b09f3bbfb4a43e7
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
From 217b154a5f65d46064ceb69ce69664105e703a74 Mon Sep 17 00:00:00 2001
From: Stephan Mueller <smueller@chronox.de>
Date: Thu, 3 Aug 2017 17:52:48 +0200
Subject: [PATCH] Do not compile unused functions
 
GCC 7 now rightfully complains about unused functions.
 
Signed-off-by: Stephan Mueller <smueller@chronox.de>
 
[Upstream commit: https://github.com/smuellerDD/libkcapi/commit/217b154a5f65d46064ceb69ce69664105e703a74]
Signed-off-by: Marcin Nowakowski <marcin.nowakowski@imgtec.com>
---
 apps/kcapi-rng.c | 2 ++
 1 file changed, 2 insertions(+)
 
diff --git a/apps/kcapi-rng.c b/apps/kcapi-rng.c
index df7decf..e15edf9 100644
--- a/apps/kcapi-rng.c
+++ b/apps/kcapi-rng.c
@@ -45,6 +45,7 @@ struct kcapi_handle *rng = NULL;
 unsigned int Verbosity = 0;
 char *rng_name = NULL;
 
+#ifndef HAVE_GETRANDOM
 static int read_complete(int fd, uint8_t *buf, uint32_t buflen)
 {
     ssize_t ret;
@@ -76,6 +77,7 @@ static int read_random(uint8_t *buf, uint32_t buflen)
     close(fd);
     return ret;
 }
+#endif
 
 static int get_random(uint8_t *buf, uint32_t buflen)
 {