aboutsummaryrefslogtreecommitdiffstats
path: root/recipes-kernel/cryptodev/sdk_patches/0091-Fix-test-compile-time-warnings.patch
blob: 639fe0fdae31b62bfe181ecf51ff16a3ae4ebf51 (plain)
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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
From a715480416b33b0bacd2b58ec42b9c64bdb21c0c Mon Sep 17 00:00:00 2001
From: Michael Weiser <michael.weiser@gmx.de>
Date: Fri, 19 Aug 2016 10:24:40 +0100
Subject: [PATCH 091/104] Fix test compile time warnings
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

A number of tests cause compiler warnings like this:

hashcrypt_speed.c: In function ‘hash_data’:
hashcrypt_speed.c:101:2: warning: implicit declaration of function ‘alarm’ [-Wimplicit-function-declaration]
  alarm(5);
  ^~~~~
hashcrypt_speed.c: In function ‘main’:
hashcrypt_speed.c:203:2: warning: implicit declaration of function ‘close’ [-Wimplicit-function-declaration]
  close(fdc);
  ^~~~~

Fix by including unistd.h.
---
 tests/hashcrypt_speed.c | 1 +
 tests/sha_speed.c       | 1 +
 tests/speed.c           | 1 +
 3 files changed, 3 insertions(+)

diff --git a/tests/hashcrypt_speed.c b/tests/hashcrypt_speed.c
index 045bf8e..10c9f00 100644
--- a/tests/hashcrypt_speed.c
+++ b/tests/hashcrypt_speed.c
@@ -21,6 +21,7 @@
 #include <stdint.h>
 #include <stdlib.h>
 #include <string.h>
+#include <unistd.h>
 #include <sys/ioctl.h>
 #include <sys/time.h>
 #include <sys/types.h>
diff --git a/tests/sha_speed.c b/tests/sha_speed.c
index 9f2c8cc..30b40f5 100644
--- a/tests/sha_speed.c
+++ b/tests/sha_speed.c
@@ -21,6 +21,7 @@
 #include <stdint.h>
 #include <stdlib.h>
 #include <string.h>
+#include <unistd.h>
 #include <sys/ioctl.h>
 #include <sys/time.h>
 #include <sys/types.h>
diff --git a/tests/speed.c b/tests/speed.c
index 3b36db1..fc38a63 100644
--- a/tests/speed.c
+++ b/tests/speed.c
@@ -22,6 +22,7 @@
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
+#include <unistd.h>
 #include <sys/ioctl.h>
 #include <sys/time.h>
 #include <sys/types.h>
-- 
2.10.2