aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKylie McClain <somasissounds@gmail.com>2016-02-01 01:36:05 +0100
committerDenys Vlasenko <vda.linux@googlemail.com>2016-02-01 01:36:05 +0100
commit40eea690c7eabbf4d12e1e0c30c31f40125ca996 (patch)
tree70f409a39ca66325026c908daaf226fd5c44e22f
parent4a79224cfcde1c941f581d0c61edaf293e743af5 (diff)
downloadbusybox-w32-40eea690c7eabbf4d12e1e0c30c31f40125ca996.tar.gz
busybox-w32-40eea690c7eabbf4d12e1e0c30c31f40125ca996.tar.bz2
busybox-w32-40eea690c7eabbf4d12e1e0c30c31f40125ca996.zip
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 <somasissounds@gmail.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
-rw-r--r--include/libbb.h5
-rw-r--r--init/init.c1
-rw-r--r--shell/ash.c1
-rw-r--r--sysklogd/klogd.c1
4 files changed, 5 insertions, 3 deletions
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 @@
20#include <netdb.h> 20#include <netdb.h>
21#include <setjmp.h> 21#include <setjmp.h>
22#include <signal.h> 22#include <signal.h>
23#include <paths.h>
23#if defined __UCLIBC__ /* TODO: and glibc? */ 24#if defined __UCLIBC__ /* TODO: and glibc? */
24/* use inlined versions of these: */ 25/* use inlined versions of these: */
25# define sigfillset(s) __sigfillset(s) 26# define sigfillset(s) __sigfillset(s)
@@ -106,7 +107,11 @@
106# define updwtmpx updwtmp 107# define updwtmpx updwtmp
107# define _PATH_UTMPX _PATH_UTMP 108# define _PATH_UTMPX _PATH_UTMP
108# else 109# else
110# include <utmp.h>
109# include <utmpx.h> 111# include <utmpx.h>
112# if defined _PATH_UTMP && !defined _PATH_UTMPX
113# define _PATH_UTMPX _PATH_UTMP
114# endif
110# endif 115# endif
111#endif 116#endif
112#if ENABLE_LOCALE_SUPPORT 117#if ENABLE_LOCALE_SUPPORT
diff --git a/init/init.c b/init/init.c
index 80c5d0f74..2040a59e8 100644
--- a/init/init.c
+++ b/init/init.c
@@ -112,7 +112,6 @@
112 112
113#include "libbb.h" 113#include "libbb.h"
114#include <syslog.h> 114#include <syslog.h>
115#include <paths.h>
116#include <sys/resource.h> 115#include <sys/resource.h>
117#ifdef __linux__ 116#ifdef __linux__
118# include <linux/vt.h> 117# include <linux/vt.h>
diff --git a/shell/ash.c b/shell/ash.c
index daec975c5..b5a2d961d 100644
--- a/shell/ash.c
+++ b/shell/ash.c
@@ -37,7 +37,6 @@
37 37
38#define JOBS ENABLE_ASH_JOB_CONTROL 38#define JOBS ENABLE_ASH_JOB_CONTROL
39 39
40#include <paths.h>
41#include <setjmp.h> 40#include <setjmp.h>
42#include <fnmatch.h> 41#include <fnmatch.h>
43#include <sys/times.h> 42#include <sys/times.h>
diff --git a/sysklogd/klogd.c b/sysklogd/klogd.c
index ca8b848bd..03d65b37f 100644
--- a/sysklogd/klogd.c
+++ b/sysklogd/klogd.c
@@ -98,7 +98,6 @@ static void klogd_close(void)
98 98
99#else 99#else
100 100
101# include <paths.h>
102# ifndef _PATH_KLOG 101# ifndef _PATH_KLOG
103# ifdef __GNU__ 102# ifdef __GNU__
104# define _PATH_KLOG "/dev/klog" 103# define _PATH_KLOG "/dev/klog"