blob: 20ef07e44afe442a4efa77f5b18d740eda2dfe67 [file] [log] [blame]
Patrick Williamsd8c66bc2016-06-20 12:57:21 -05001From be0bb81d72fea4d20da74f4f2236aa145684f332 Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com>
3Date: Wed, 6 Jan 2016 14:14:22 -0800
4Subject: [PATCH] Fix header inclusion for musl
5
6Fix errors e.g.
7
8In file included from tracepath.c:17:0:
9/usr/include/linux/errqueue.h:33:18:
10error: array type has incomplete element type 'struct timespec'
11 struct timespec ts[3];
12 ^
13tracepath.c: In function 'main':
14tracepath.c:329:16: error: 'INT_MAX' undeclared (first use in this
15function)
16 overhead, INT_MAX);
17 ^
18tracepath.c:329:16: note: each undeclared identifier is reported only
19once for each function it appears in
20Makefile:131: recipe for target 'tracepath.o' failed
21make: *** [tracepath.o] Error 1
22
23ping_common.c: In function 'main_loop':
24ping_common.c:756:15: error: 'HZ' undeclared (first use in this
25function)
26 if (1000 % HZ == 0 ? next <= 1000 / HZ : (next < INT_MAX / HZ &&
27next * HZ <= 1000)) {
28
29protocols/timed.h is not needed and is absent in musl
30
31Signed-off-by: Khem Raj <raj.khem@gmail.com>
32---
33Upstream-Status: Pending
34
35 clockdiff.c | 1 -
36 ping_common.c | 1 +
37 tracepath.c | 2 ++
38 tracepath6.c | 1 +
39 4 files changed, 4 insertions(+), 1 deletion(-)
40
41diff --git a/clockdiff.c b/clockdiff.c
42index 7c1ea1b..1d6341e 100644
43--- a/clockdiff.c
44+++ b/clockdiff.c
45@@ -14,7 +14,6 @@
46 #include <netinet/ip.h>
47 #include <netinet/ip_icmp.h>
48 #define TSPTYPES
49-#include <protocols/timed.h>
50 #include <fcntl.h>
51 #include <netdb.h>
52 #include <arpa/inet.h>
53diff --git a/ping_common.c b/ping_common.c
54index 7f82851..3ce699d 100644
55--- a/ping_common.c
56+++ b/ping_common.c
57@@ -2,6 +2,7 @@
58 #include <ctype.h>
59 #include <sched.h>
60 #include <math.h>
61+#include <asm-generic/param.h>
62
63 int options;
64
65diff --git a/tracepath.c b/tracepath.c
66index 89e6d16..c9d6ddd 100644
67--- a/tracepath.c
68+++ b/tracepath.c
69@@ -12,6 +12,8 @@
70 #include <stdio.h>
71 #include <stdlib.h>
72 #include <unistd.h>
73+#include <limits.h>
74+#include <time.h>
75 #include <sys/socket.h>
76 #include <linux/types.h>
77 #include <linux/errqueue.h>
78diff --git a/tracepath6.c b/tracepath6.c
79index 126fadf..9d5745c 100644
80--- a/tracepath6.c
81+++ b/tracepath6.c
82@@ -12,6 +12,7 @@
83 #include <stdio.h>
84 #include <stdlib.h>
85 #include <unistd.h>
86+#include <limits.h>
87 #include <sys/socket.h>
88 #include <netinet/in.h>
89 #include <netinet/icmp6.h>
90--
912.6.4
92