aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Renshaw <osm0sis@outlook.com>2015-12-17 16:42:01 +0100
committerDenys Vlasenko <vda.linux@googlemail.com>2015-12-17 16:42:41 +0100
commit6df961257d584714c5690b1f4197c677e4f832ec (patch)
treeff33f9a5fb3f68338dd4e737cbd4b8bd4546aae9
parente0942acb9e186cbfc16afe704e10a8af9cd1cc58 (diff)
downloadbusybox-w32-6df961257d584714c5690b1f4197c677e4f832ec.tar.gz
busybox-w32-6df961257d584714c5690b1f4197c677e4f832ec.tar.bz2
busybox-w32-6df961257d584714c5690b1f4197c677e4f832ec.zip
Resolve linker issues with Android API 21 (dprintf, tcdrain)
Signed-off-by: Chris Renshaw <osm0sis@outlook.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
-rw-r--r--include/platform.h7
-rw-r--r--libbb/missing_syscalls.c2
2 files changed, 8 insertions, 1 deletions
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;
481 481
482#if defined(ANDROID) || defined(__ANDROID__) 482#if defined(ANDROID) || defined(__ANDROID__)
483# if __ANDROID_API__ < 8 483# if __ANDROID_API__ < 8
484 /* ANDROID < 8 has no [f]dprintf at all */
484# undef HAVE_DPRINTF 485# undef HAVE_DPRINTF
485# else 486# elif __ANDROID_API__ < 21
487 /* ANDROID < 21 has fdprintf */
486# define dprintf fdprintf 488# define dprintf fdprintf
489# else
490 /* ANDROID >= 21 has standard dprintf */
491# endif
487# endif 492# endif
488# if __ANDROID_API__ < 21 493# if __ANDROID_API__ < 21
489# undef HAVE_TTYNAME_R 494# undef HAVE_TTYNAME_R
diff --git a/libbb/missing_syscalls.c b/libbb/missing_syscalls.c
index e3c1e924b..093412811 100644
--- a/libbb/missing_syscalls.c
+++ b/libbb/missing_syscalls.c
@@ -40,8 +40,10 @@ int pivot_root(const char *new_root, const char *put_old)
40 return syscall(__NR_pivot_root, new_root, put_old); 40 return syscall(__NR_pivot_root, new_root, put_old);
41} 41}
42 42
43# if __ANDROID_API__ < 21
43int tcdrain(int fd) 44int tcdrain(int fd)
44{ 45{
45 return ioctl(fd, TCSBRK, 1); 46 return ioctl(fd, TCSBRK, 1);
46} 47}
48# endif
47#endif 49#endif