diff options
author | Denys Vlasenko <vda.linux@googlemail.com> | 2010-02-02 12:45:38 +0100 |
---|---|---|
committer | Denys Vlasenko <vda.linux@googlemail.com> | 2010-02-02 12:45:38 +0100 |
commit | bb1dcc9aab5f517d963b601289aa75508d6e088e (patch) | |
tree | 682957f7a02ac69cbe9c1adb5f22092bfd379de2 /include/libbb.h | |
parent | 5b9b1365a086056e992e7868db8e49989fedcbaf (diff) | |
download | busybox-w32-bb1dcc9aab5f517d963b601289aa75508d6e088e.tar.gz busybox-w32-bb1dcc9aab5f517d963b601289aa75508d6e088e.tar.bz2 busybox-w32-bb1dcc9aab5f517d963b601289aa75508d6e088e.zip |
more thorough fix for systems with strange socklen_t
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'include/libbb.h')
-rw-r--r-- | include/libbb.h | 40 |
1 files changed, 23 insertions, 17 deletions
diff --git a/include/libbb.h b/include/libbb.h index 3b7eea286..9e3c18407 100644 --- a/include/libbb.h +++ b/include/libbb.h | |||
@@ -30,10 +30,6 @@ | |||
30 | #include <sys/ioctl.h> | 30 | #include <sys/ioctl.h> |
31 | #include <sys/mman.h> | 31 | #include <sys/mman.h> |
32 | #include <sys/socket.h> | 32 | #include <sys/socket.h> |
33 | #if defined __FreeBSD__ | ||
34 | # include <netinet/in.h> | ||
35 | # include <arpa/inet.h> | ||
36 | #endif | ||
37 | #include <sys/stat.h> | 33 | #include <sys/stat.h> |
38 | #include <sys/time.h> | 34 | #include <sys/time.h> |
39 | #include <sys/types.h> | 35 | #include <sys/types.h> |
@@ -44,39 +40,26 @@ | |||
44 | /* Try to pull in PATH_MAX */ | 40 | /* Try to pull in PATH_MAX */ |
45 | #include <limits.h> | 41 | #include <limits.h> |
46 | #include <sys/param.h> | 42 | #include <sys/param.h> |
47 | #ifndef PATH_MAX | ||
48 | # define PATH_MAX 256 | ||
49 | #endif | ||
50 | |||
51 | #ifndef BUFSIZ | ||
52 | # define BUFSIZ 4096 | ||
53 | #endif | ||
54 | |||
55 | #ifdef HAVE_MNTENT_H | 43 | #ifdef HAVE_MNTENT_H |
56 | #include <mntent.h> | 44 | #include <mntent.h> |
57 | #endif | 45 | #endif |
58 | |||
59 | #ifdef HAVE_SYS_STATFS_H | 46 | #ifdef HAVE_SYS_STATFS_H |
60 | #include <sys/statfs.h> | 47 | #include <sys/statfs.h> |
61 | #endif | 48 | #endif |
62 | |||
63 | #if ENABLE_SELINUX | 49 | #if ENABLE_SELINUX |
64 | #include <selinux/selinux.h> | 50 | #include <selinux/selinux.h> |
65 | #include <selinux/context.h> | 51 | #include <selinux/context.h> |
66 | #include <selinux/flask.h> | 52 | #include <selinux/flask.h> |
67 | #include <selinux/av_permissions.h> | 53 | #include <selinux/av_permissions.h> |
68 | #endif | 54 | #endif |
69 | |||
70 | #if ENABLE_LOCALE_SUPPORT | 55 | #if ENABLE_LOCALE_SUPPORT |
71 | # include <locale.h> | 56 | # include <locale.h> |
72 | #else | 57 | #else |
73 | # define setlocale(x,y) ((void)0) | 58 | # define setlocale(x,y) ((void)0) |
74 | #endif | 59 | #endif |
75 | |||
76 | #ifdef DMALLOC | 60 | #ifdef DMALLOC |
77 | # include <dmalloc.h> | 61 | # include <dmalloc.h> |
78 | #endif | 62 | #endif |
79 | |||
80 | #include <pwd.h> | 63 | #include <pwd.h> |
81 | #include <grp.h> | 64 | #include <grp.h> |
82 | #if ENABLE_FEATURE_SHADOWPASSWDS | 65 | #if ENABLE_FEATURE_SHADOWPASSWDS |
@@ -87,6 +70,23 @@ | |||
87 | # include <shadow.h> | 70 | # include <shadow.h> |
88 | # endif | 71 | # endif |
89 | #endif | 72 | #endif |
73 | #if defined __FreeBSD__ | ||
74 | # include <netinet/in.h> | ||
75 | # include <arpa/inet.h> | ||
76 | #elif defined __APPLE__ | ||
77 | # include <netinet/in.h> | ||
78 | #else | ||
79 | # include <arpa/inet.h> | ||
80 | # if !defined(__socklen_t_defined) && !defined(_SOCKLEN_T_DECLARED) | ||
81 | /* We #define socklen_t *after* includes, otherwise we get | ||
82 | * typedef redefinition errors from system headers | ||
83 | * (in case "is it defined already" detection above failed) | ||
84 | */ | ||
85 | # define socklen_t bb_socklen_t | ||
86 | typedef unsigned socklen_t; | ||
87 | # endif | ||
88 | #endif | ||
89 | |||
90 | 90 | ||
91 | /* Some libc's forget to declare these, do it ourself */ | 91 | /* Some libc's forget to declare these, do it ourself */ |
92 | 92 | ||
@@ -121,6 +121,12 @@ struct sysinfo { | |||
121 | char _f[20 - 2 * sizeof(long) - sizeof(int)]; /* Padding: libc5 uses this.. */ | 121 | char _f[20 - 2 * sizeof(long) - sizeof(int)]; /* Padding: libc5 uses this.. */ |
122 | }; | 122 | }; |
123 | int sysinfo(struct sysinfo* info); | 123 | int sysinfo(struct sysinfo* info); |
124 | #ifndef PATH_MAX | ||
125 | # define PATH_MAX 256 | ||
126 | #endif | ||
127 | #ifndef BUFSIZ | ||
128 | # define BUFSIZ 4096 | ||
129 | #endif | ||
124 | 130 | ||
125 | 131 | ||
126 | /* Make all declarations hidden (-fvisibility flag only affects definitions) */ | 132 | /* Make all declarations hidden (-fvisibility flag only affects definitions) */ |