]> code.ossystems Code Review - openembedded-core.git/blob
8afed5c0dbdc0bb279a5254022a1c61c0fc34535
[openembedded-core.git] /
1 From 83ec34df357218a1c9cfc13a23d3367d333652c3 Mon Sep 17 00:00:00 2001
2 From: Khem Raj <raj.khem@gmail.com>
3 Date: Wed, 30 Dec 2015 01:01:15 +0000
4 Subject: [PATCH] Fix build issues found with non glibc C libraries
5
6 Add time.h for getting time_t definition
7 limits.h for PATH_MAX
8 linux/param.h for EXEC_PAGESIZE
9 Replace deprecated MNTTAB with _PATH_MNTTAB
10 include ext2_mnt.h for MNTOPT_USRQUOTA and MNTOPT_GRPQUOTA and
11 MNTTYPE_EXT2
12 Include sys/types.h for u_char definition
13
14 Signed-off-by: Khem Raj <raj.khem@gmail.com>
15 ---
16
17 Upstream-Status: Submitted
18
19  include/extern.h | 1 +
20  src/configfile.c | 1 +
21  src/memory.c     | 3 +++
22  src/net.c        | 1 +
23  src/shutdown.c   | 3 ++-
24  5 files changed, 8 insertions(+), 1 deletion(-)
25
26 diff --git a/include/extern.h b/include/extern.h
27 index 21db11b..04b16bc 100644
28 --- a/include/extern.h
29 +++ b/include/extern.h
30 @@ -3,6 +3,7 @@
31  
32  #include <netinet/in.h>
33  #include <stdio.h>
34 +#include <time.h>
35  
36  #include "logmessage.h"
37  #include "xmalloc.h"
38 diff --git a/src/configfile.c b/src/configfile.c
39 index be5d7b3..7c1d1dd 100644
40 --- a/src/configfile.c
41 +++ b/src/configfile.c
42 @@ -16,6 +16,7 @@
43  #include <errno.h>
44  #include <string.h>
45  #include <dirent.h>
46 +#include <limits.h>
47  #include <sys/stat.h>
48  
49  #include "extern.h"
50 diff --git a/src/memory.c b/src/memory.c
51 index e9607e4..b5e08aa 100644
52 --- a/src/memory.c
53 +++ b/src/memory.c
54 @@ -21,6 +21,9 @@
55  #include <sys/stat.h>
56  #include <sys/param.h>
57  #include <sys/mman.h>
58 +#ifdef __linux__
59 +#include <linux/param.h>
60 +#endif
61  
62  #include "extern.h"
63  #include "watch_err.h"
64 diff --git a/src/net.c b/src/net.c
65 index 21823ae..8930caf 100644
66 --- a/src/net.c
67 +++ b/src/net.c
68 @@ -17,6 +17,7 @@
69  #include <string.h>
70  #include <unistd.h>            /* for gethostname() etc */
71  #include <netdb.h>             /* for gethostbyname() */
72 +#include <sys/types.h>
73  #include <sys/param.h> /* for MAXHOSTNAMELEN */
74  #include <sys/socket.h>
75  #include <netinet/in.h>
76 diff --git a/src/shutdown.c b/src/shutdown.c
77 index 74aafa5..46b99cf 100644
78 --- a/src/shutdown.c
79 +++ b/src/shutdown.c
80 @@ -25,6 +25,7 @@
81  
82  #include "watch_err.h"
83  #include "extern.h"
84 +#include "ext2_mnt.h"
85  
86  #if defined __GLIBC__
87  #include "ext2_mnt.h"
88 @@ -123,7 +124,7 @@ static void mnt_off()
89         FILE *fp;
90         struct mntent *mnt;
91  
92 -       fp = setmntent(MNTTAB, "r");
93 +       fp = setmntent(_PATH_MNTTAB, "r");
94         /* in some rare cases fp might be NULL so be careful */
95         while (fp != NULL && ((mnt = getmntent(fp)) != (struct mntent *)0)) {
96                 /* First check if swap */
97 -- 
98 2.6.4
99