summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorBernhard Reutner-Fischer2015-04-19 23:45:17 +0200
committerBernhard Reutner-Fischer2015-04-20 15:24:30 +0200
commit7d86384b246434e72533332f7f409a7aa9efeacb (patch)
tree6d33165be02886a6a4d032db6293c247576b4e91 /include
parent61d6ae244af424b2a05468307723f21c8810ab9e (diff)
downloadbusybox-7d86384b246434e72533332f7f409a7aa9efeacb.zip
busybox-7d86384b246434e72533332f7f409a7aa9efeacb.tar.gz
include: Fallback to UTMP unless there is UTMPX support
Fixes compilation against uClibc-0.9.30 for instance Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
Diffstat (limited to 'include')
-rw-r--r--include/libbb.h25
1 files changed, 24 insertions, 1 deletions
diff --git a/include/libbb.h b/include/libbb.h
index 21da5f1..f0ac1f5 100644
--- a/include/libbb.h
+++ b/include/libbb.h
@@ -84,7 +84,30 @@
# include <selinux/av_permissions.h>
#endif
#if ENABLE_FEATURE_UTMP
-# include <utmpx.h>
+# if defined __UCLIBC__ && ( \
+ (UCLIBC_VERSION >= KERNEL_VERSION(0, 9, 32) \
+ && UCLIBC_VERSION < KERNEL_VERSION(0, 9, 34) \
+ && defined __UCLIBC_HAS_UTMPX__ \
+ ) || ( \
+ UCLIBC_VERSION >= KERNEL_VERSION(0, 9, 34) \
+ ) \
+ )
+# include <utmpx.h>
+# elif defined __UCLIBC__
+# include <utmp.h>
+# define utmpx utmp
+# define setutxent setutent
+# define endutxent endutent
+# define getutxent getutent
+# define getutxid getutid
+# define getutxline getutline
+# define pututxline pututline
+# define utmpxname utmpname
+# define updwtmpx updwtmp
+# define _PATH_UTMPX _PATH_UTMP
+# else
+# include <utmpx.h>
+# endif
#endif
#if ENABLE_LOCALE_SUPPORT
# include <locale.h>