Skip to content

Commit fd4d497

Browse files
mydongistinydarkobas
authored andcommitted
busybox: Clean up imports for 8.0
also hide some warnings Change-Id: I8b6beb5ced175410a1bfae9db4dc46b271436a89 Signed-off-by: mydongistiny <[email protected]>
1 parent 59057b7 commit fd4d497

File tree

9 files changed

+17
-31
lines changed

9 files changed

+17
-31
lines changed

Android.mk

+6-2
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@ BB_PATH := $(LOCAL_PATH)
77
BIONIC_ICS := false
88
BIONIC_L := true
99

10+
BUSYBOX_WARNING_HIDE := -Wno-error=implicit-function-declaration -Wno-implicit-function-declaration -Wno-implicit-fallthrough \
11+
-Wno-sign-compare -Wno-format-overflow -Wno-shift-negative-value -Wno-logical-not-parentheses -Wno-return-type
12+
1013
# Make a static library for regex.
1114
include $(CLEAR_VARS)
1215
LOCAL_SRC_FILES := android/regex/bb_regex.c
@@ -20,7 +23,7 @@ include $(CLEAR_VARS)
2023
LOCAL_SRC_FILES := $(shell cat $(BB_PATH)/android/librpc.sources)
2124
LOCAL_C_INCLUDES := $(BB_PATH)/android/librpc
2225
LOCAL_MODULE := libuclibcrpc
23-
LOCAL_CFLAGS += -fno-strict-aliasing
26+
LOCAL_CFLAGS += -fno-strict-aliasing $(BUSYBOX_WARNING_HIDE)
2427
LOCAL_CLANG := false
2528
ifeq ($(BIONIC_L),true)
2629
LOCAL_CFLAGS += -DBIONIC_ICS -DBIONIC_L
@@ -102,11 +105,12 @@ BUSYBOX_C_INCLUDES = \
102105
$(BB_PATH)/android/librpc
103106

104107
BUSYBOX_CFLAGS = \
105-
-Werror=implicit -Wno-clobbered \
108+
-Wno-clobbered \
106109
-DNDEBUG \
107110
-DANDROID \
108111
-fno-strict-aliasing \
109112
-fno-builtin-stpcpy \
113+
$(BUSYBOX_WARNING_HIDE) \
110114
-include $(bb_gen)/$(BUSYBOX_CONFIG)/include/autoconf.h \
111115
-D'CONFIG_DEFAULT_MODULES_DIR="$(KERNEL_MODULES_DIR)"' \
112116
-D'BB_VER="$(strip $(shell $(SUBMAKE) kernelversion)) $(BUSYBOX_SUFFIX)"' -DBB_BT=AUTOCONF_TIMESTAMP

android/android.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ char *hasmntopt(const struct mntent *mnt, const char *opt)
8989

9090
/* declared in grp.h, but not necessary */
9191
#if !ENABLE_USE_BB_PWD_GRP
92-
int setpwent() { return 0; }
92+
9393
void setgrent() {}
9494
void endgrent() {}
9595
#endif

android/librpc/bindresvport.c

+1
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ extern long __set_errno(int n);
4444
#endif
4545
#include <sys/socket.h>
4646
#include <netinet/in.h>
47+
#include <netdb.h>
4748

4849

4950
/*

android/selinux/android_selinux.h

-9
Original file line numberDiff line numberDiff line change
@@ -133,15 +133,6 @@ extern int selinux_check_passwd_access(access_vector_t requested);
133133

134134
#define selinux_policy_root() "/sepolicy"
135135

136-
static int selinux_getenforcemode(int *rc)
137-
{
138-
if (rc) {
139-
*rc = security_getenforce();
140-
return 0;
141-
}
142-
return -1;
143-
}
144-
145136
static const char *selinux_file_contexts_path()
146137
{
147138
return "/file_contexts";

android/selinux/android_selinux_internal.h

-1
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,6 @@ hidden_proto(selinux_mkload_policy)
116116
hidden_proto(selinux_usersconf_path);
117117
hidden_proto(selinux_translations_path);
118118
hidden_proto(selinux_colors_path);
119-
hidden_proto(selinux_getenforcemode);
120119
hidden_proto(selinux_getpolicytype);
121120
hidden_proto(selinux_raw_to_trans_context);
122121
hidden_proto(selinux_trans_to_raw_context);

networking/libiproute/iplink.c

+1
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
/*#include <net/if_packet.h> - not needed? */
1010
#include <netpacket/packet.h>
1111
#include <netinet/if_ether.h>
12+
#include <linux/if_ether.h>
1213

1314
#include <linux/if_vlan.h>
1415
#include "ip_common.h" /* #include "libbb.h" is inside */

networking/libiproute/ll_proto.c

+1
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
#include "utils.h"
1414

1515
#include <netinet/if_ether.h>
16+
#include <linux/if_ether.h>
1617

1718
/* Please conditionalize exotic protocols on CONFIG_something */
1819

networking/nslookup.c

+7-12
Original file line numberDiff line numberDiff line change
@@ -27,32 +27,27 @@
2727

2828
#include <resolv.h>
2929
#include "libbb.h"
30+
#include <netdb.h>
3031

3132
#ifdef ANDROID
3233
# include <netinet/in.h>
34+
# include <arpa/nameser.h>
35+
# include <dns/include/resolv_private.h>
36+
# include <dns/resolv/res_private.h>
3337
# if ENABLE_FEATURE_IPV6
3438
# include <netinet/in6.h>
3539
# endif
36-
# define ANDROID_CHANGES
37-
# ifdef BIONIC_L
38-
# include <arpa/nameser.h>
39-
# include <dns/include/resolv_private.h>
40-
# include <dns/resolv/res_private.h>
41-
# else
42-
# include <arpa_nameser.h>
43-
# include <private/resolv_private.h>
44-
# include <netbsd/resolv/res_private.h>
45-
# endif
4640

4741
static struct __res_state res_st;
4842
struct __res_state * __res_state(void)
4943
{
50-
return &res_st;
44+
return &res_st;
5145
}
52-
#endif
5346

5447
#define EXT(res) ((&res)->_u._ext)
5548

49+
# endif
50+
5651
/*
5752
* I'm only implementing non-interactive mode;
5853
* I totally forgot nslookup even had an interactive mode.

selinux/sestatus.c

-6
Original file line numberDiff line numberDiff line change
@@ -180,12 +180,6 @@ int sestatus_main(int argc UNUSED_PARAM, char **argv)
180180
printf(COL_FMT "%s\n", "Current mode:",
181181
rc == 0 ? "permissive" : "enforcing");
182182

183-
/* Mode from config file: line */
184-
if (selinux_getenforcemode(&rc) != 0)
185-
goto error;
186-
printf(COL_FMT "%s\n", "Mode from config file:",
187-
rc < 0 ? "disabled" : (rc == 0 ? "permissive" : "enforcing"));
188-
189183
/* Policy version: line */
190184
rc = security_policyvers();
191185
if (rc < 0)

0 commit comments

Comments
 (0)