summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBernhard Rosenkraenzer <Bernhard.Rosenkranzer@linaro.org>2012-11-15 22:24:15 +0100
committerBernhard Rosenkraenzer <Bernhard.Rosenkranzer@linaro.org>2012-11-15 22:24:15 +0100
commit3d23b85dd8e58ff5a697957c7fdfe2706e8cbf41 (patch)
tree7d9003269c6adb9c70f5a3b15db1fa51368ad041
parent933bee7dcc5c45af88644998e9ba0aec165ea1bd (diff)
downloadlrzsz-linaro-master.tar.gz
lrzsz: Fix build with Jellybean 4.2linaro-master
4.2 adds tcdrain(), so we can't define it here again Change-Id: Ice561cf0fffdc4f02701531f5df41e132b4cfac8 Signed-off-by: Bernhard Rosenkraenzer <Bernhard.Rosenkranzer@linaro.org>
-rw-r--r--rbsb.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/rbsb.c b/rbsb.c
index be9a54f..c99e3c6 100644
--- a/rbsb.c
+++ b/rbsb.c
@@ -54,14 +54,23 @@ long Locbit = LLITOUT; /* Bit SUPPOSED to disable output translations */
# endif
#endif
-/* Android lacks tcdrain() */
#ifdef ANDROID
+/* Android prior to 4.2 lacks tcdrain().
+ * What we're doing here is fairly evil - but necessary since
+ * Bionic doesn't export any version identifier or the likes.
+ * We do know that 4.2 is the version introducing tcdrain() and
+ * also KLOG_CONSOLE_OFF -- completely unrelated, but something
+ * we can check for...
+ */
+#include <sys/klog.h>
+#ifndef KLOG_CONSOLE_OFF
#include <sys/ioctl.h>
static inline int tcdrain(int fd)
{
return ioctl(fd, TCSBRK, 1);
}
#endif
+#endif
#if defined(HOWMANY) && HOWMANY > 255
#ifndef NFGVMIN