From 7d86384b246434e72533332f7f409a7aa9efeacb Mon Sep 17 00:00:00 2001 From: Bernhard Reutner-Fischer Date: Sun, 19 Apr 2015 23:45:17 +0200 Subject: include: Fallback to UTMP unless there is UTMPX support Fixes compilation against uClibc-0.9.30 for instance Signed-off-by: Bernhard Reutner-Fischer --- include/libbb.h | 25 ++++++++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) (limited to 'include') 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 #endif #if ENABLE_FEATURE_UTMP -# include +# 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 +# elif defined __UCLIBC__ +# include +# 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 +# endif #endif #if ENABLE_LOCALE_SUPPORT # include -- cgit v1.1