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 +++++ 1 file changed, 5 insertions(+) (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 -- cgit v1.2.3