From 53c4dd817da9a5eed76662990300d96d800e40f5 Mon Sep 17 00:00:00 2001 From: Joachim Nilsson Date: Sun, 5 Aug 2018 16:51:13 +0200 Subject: [PATCH] Fix archaic #include statements, for building with musl libc Signed-off-by: Joachim Nilsson --- src/klogd.c | 14 +++++--------- src/ksym_mod.c | 9 +++++---- src/pidfile.c | 1 + src/syslog.c | 7 +------ src/syslogd.c | 8 +------- 5 files changed, 13 insertions(+), 26 deletions(-) diff --git a/src/klogd.c b/src/klogd.c index 384da91..0eb701a 100644 --- a/src/klogd.c +++ b/src/klogd.c @@ -260,11 +260,12 @@ #include #include #include -#include +#ifdef SYSV +#include +#else +#include +#endif #include -#if !defined(__GLIBC__) -#include -#endif /* __GLIBC__ */ #include #include #include @@ -277,13 +278,8 @@ #define __LIBRARY__ #include -#if !defined(__GLIBC__) -# define __NR_ksyslog __NR_syslog -_syscall3(int,ksyslog,int, type, char *, buf, int, len); -#else #include #define ksyslog klogctl -#endif #define LOG_BUFFER_SIZE 4096 #define LOG_LINE_LENGTH 1000 diff --git a/src/ksym_mod.c b/src/ksym_mod.c index 1a45c85..4551510 100644 --- a/src/ksym_mod.c +++ b/src/ksym_mod.c @@ -113,12 +113,13 @@ #include #include #include -#include +#ifdef SYSV +#include +#else +#include +#endif #include #include "module.h" -#if !defined(__GLIBC__) -#include -#endif /* __GLIBC__ */ #include #include #include diff --git a/src/pidfile.c b/src/pidfile.c index cf53b49..5b09625 100644 --- a/src/pidfile.c +++ b/src/pidfile.c @@ -31,6 +31,7 @@ #include #include #include +#include /* read_pid * diff --git a/src/syslog.c b/src/syslog.c index bdb3ff2..99b968d 100644 --- a/src/syslog.c +++ b/src/syslog.c @@ -55,13 +55,7 @@ static char sccsid[] = "@(#)syslog.c 5.28 (Berkeley) 6/27/90"; #include #include #include -#include #include -#if 0 -#include "syslog.h" -#include "pathnames.h" -#endif - #include #include #include @@ -72,6 +66,7 @@ static char sccsid[] = "@(#)syslog.c 5.28 (Berkeley) 6/27/90"; #include #include #include +#include #define _PATH_LOGNAME "/dev/log" diff --git a/src/syslogd.c b/src/syslogd.c index 6b16614..6357022 100644 --- a/src/syslogd.c +++ b/src/syslogd.c @@ -524,9 +524,7 @@ static char sccsid[] = "@(#)syslogd.c 5.27 (Berkeley) 10/10/88"; #include #include #include -#ifdef SYSV #include -#endif #include #include #include @@ -537,17 +535,13 @@ static char sccsid[] = "@(#)syslogd.c 5.27 (Berkeley) 10/10/88"; #define SYSLOG_NAMES #include #include -#include +#include #include #include #include #include #include -#ifdef SYSV #include -#else -#include -#endif #include #include #include