From 6df961257d584714c5690b1f4197c677e4f832ec Mon Sep 17 00:00:00 2001 From: Chris Renshaw Date: Thu, 17 Dec 2015 16:42:01 +0100 Subject: Resolve linker issues with Android API 21 (dprintf, tcdrain) Signed-off-by: Chris Renshaw Signed-off-by: Denys Vlasenko --- include/platform.h | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'include') diff --git a/include/platform.h b/include/platform.h index 1706b1847..026ebbe17 100644 --- a/include/platform.h +++ b/include/platform.h @@ -481,9 +481,14 @@ typedef unsigned smalluint; #if defined(ANDROID) || defined(__ANDROID__) # if __ANDROID_API__ < 8 + /* ANDROID < 8 has no [f]dprintf at all */ # undef HAVE_DPRINTF -# else +# elif __ANDROID_API__ < 21 + /* ANDROID < 21 has fdprintf */ # define dprintf fdprintf +# else + /* ANDROID >= 21 has standard dprintf */ +# endif # endif # if __ANDROID_API__ < 21 # undef HAVE_TTYNAME_R -- cgit v1.2.3-55-g6feb From b50525124228b566ccfd5c6df0647988bb2d2d3a Mon Sep 17 00:00:00 2001 From: Ari Sundholm Date: Thu, 17 Dec 2015 20:43:12 +0200 Subject: include/platform.h: Remove extra #endif introduced in 6df9612. It causes the compilation to fail. Signed-off-by: Ari Sundholm Signed-off-by: Mike Frysinger --- include/platform.h | 1 - 1 file changed, 1 deletion(-) (limited to 'include') diff --git a/include/platform.h b/include/platform.h index 026ebbe17..c987d418c 100644 --- a/include/platform.h +++ b/include/platform.h @@ -489,7 +489,6 @@ typedef unsigned smalluint; # else /* ANDROID >= 21 has standard dprintf */ # endif -# endif # if __ANDROID_API__ < 21 # undef HAVE_TTYNAME_R # undef HAVE_GETLINE -- cgit v1.2.3-55-g6feb From 40eea690c7eabbf4d12e1e0c30c31f40125ca996 Mon Sep 17 00:00:00 2001 From: Kylie McClain Date: Mon, 1 Feb 2016 01:36:05 +0100 Subject: Fix compiling with musl's utmp stubs This patch fixes compiling busybox with FEATURE_UTMP and _WTMP enabled. musl, while not really support utmp/wtmp, provides stub functions, as well as variables such as _PATH_UTMP, so that programs using utmp or wtmp can still compile fine. My reasoning for this patch is that on Exherbo, I'm currently trying to get us to be able to use the same busybox config file for both glibc and musl systems, using utmp/wtmp on systems that support it, and using the stubs on musl without needing two different configs. As of latest musl git, it provides all utmp functions needed; 1.1.12 doesn't, but I sent a patch to Rich to add the utmp{,x}name functions expected to exist, which was merged into musl upstream. Signed-off-by: Kylie McClain Signed-off-by: Denys Vlasenko --- include/libbb.h | 5 +++++ init/init.c | 1 - shell/ash.c | 1 - sysklogd/klogd.c | 1 - 4 files changed, 5 insertions(+), 3 deletions(-) (limited to 'include') diff --git a/include/libbb.h b/include/libbb.h index 82484f911..d05ac2976 100644 --- a/include/libbb.h +++ b/include/libbb.h @@ -20,6 +20,7 @@ #include #include #include +#include #if defined __UCLIBC__ /* TODO: and glibc? */ /* use inlined versions of these: */ # define sigfillset(s) __sigfillset(s) @@ -106,7 +107,11 @@ # define updwtmpx updwtmp # define _PATH_UTMPX _PATH_UTMP # else +# include # include +# if defined _PATH_UTMP && !defined _PATH_UTMPX +# define _PATH_UTMPX _PATH_UTMP +# endif # endif #endif #if ENABLE_LOCALE_SUPPORT diff --git a/init/init.c b/init/init.c index 80c5d0f74..2040a59e8 100644 --- a/init/init.c +++ b/init/init.c @@ -112,7 +112,6 @@ #include "libbb.h" #include -#include #include #ifdef __linux__ # include diff --git a/shell/ash.c b/shell/ash.c index daec975c5..b5a2d961d 100644 --- a/shell/ash.c +++ b/shell/ash.c @@ -37,7 +37,6 @@ #define JOBS ENABLE_ASH_JOB_CONTROL -#include #include #include #include diff --git a/sysklogd/klogd.c b/sysklogd/klogd.c index ca8b848bd..03d65b37f 100644 --- a/sysklogd/klogd.c +++ b/sysklogd/klogd.c @@ -98,7 +98,6 @@ static void klogd_close(void) #else -# include # ifndef _PATH_KLOG # ifdef __GNU__ # define _PATH_KLOG "/dev/klog" -- cgit v1.2.3-55-g6feb