kumquat-buildroot/package/sysklogd/0002-Fix-improper-header-includes.patch
Thomas Petazzoni 55b1114f72 sysklogd: fix build on musl
This commit add a stack of small patches that make sysklogd build fine
with the musl C library. Build with uClibc and glibc has been tested
with those patches applied as well.

The first patch is slightly rework (better description and capital
letter to the title) in preparation for upstream submission.

Fixes:

  http://autobuild.buildroot.net/results/8fa2bf73f983330884bce2e5ac31e01dee112ba9/

Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
2016-12-06 11:28:43 +01:00

79 lines
2.0 KiB
Diff

From 7a043f619a91fbb998863c08e3e5e94a4747b11d Mon Sep 17 00:00:00 2001
From: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Date: Mon, 28 Nov 2016 23:07:36 +0100
Subject: [PATCH] Fix improper header includes
When building with the musl C library, a number of warnings indicate
that sysklogd is directly including headers that are considered internal
to the C library:
- Instead of including <sys/fcntl.h>, <fcntl.h> should be included.
- Instead of including <sys/signal.h>, <signal.h> should be included.
- Instead of includeing <sys/errno.h>, <errno.h> should be included.
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
---
klogd.c | 2 +-
ksym_mod.c | 2 +-
syslog.c | 2 +-
syslogd.c | 2 +-
4 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/klogd.c b/klogd.c
index 6cc80ed..a173353 100644
--- a/klogd.c
+++ b/klogd.c
@@ -260,7 +260,7 @@
#include <unistd.h>
#include <signal.h>
#include <errno.h>
-#include <sys/fcntl.h>
+#include <fcntl.h>
#include <sys/stat.h>
#if !defined(__GLIBC__)
#include <linux/time.h>
diff --git a/ksym_mod.c b/ksym_mod.c
index 68cd6b6..2e69d65 100644
--- a/ksym_mod.c
+++ b/ksym_mod.c
@@ -113,7 +113,7 @@
#include <unistd.h>
#include <signal.h>
#include <errno.h>
-#include <sys/fcntl.h>
+#include <fcntl.h>
#include <sys/stat.h>
#include "module.h"
#if !defined(__GLIBC__)
diff --git a/syslog.c b/syslog.c
index bdb3ff2..f96b43c 100644
--- a/syslog.c
+++ b/syslog.c
@@ -55,7 +55,7 @@ static char sccsid[] = "@(#)syslog.c 5.28 (Berkeley) 6/27/90";
#include <sys/types.h>
#include <sys/socket.h>
#include <sys/file.h>
-#include <sys/signal.h>
+#include <signal.h>
#include <sys/syslog.h>
#if 0
#include "syslog.h"
diff --git a/syslogd.c b/syslogd.c
index ace96c8..b5e8054 100644
--- a/syslogd.c
+++ b/syslogd.c
@@ -521,7 +521,7 @@ static char sccsid[] = "@(#)syslogd.c 5.27 (Berkeley) 10/10/88";
#define SYSLOG_NAMES
#include <sys/syslog.h>
#include <sys/param.h>
-#include <sys/errno.h>
+#include <errno.h>
#include <sys/ioctl.h>
#include <sys/stat.h>
#include <sys/wait.h>
--
2.7.4