commit: e0c32c23dc00d7aff79614129614944f4b1fde92
Author: William Hubbs gmail com>
AuthorDate: Thu Oct 23 23:47:04 2014 +
Commit: William Hubbs gentoo org>
CommitDate: Fri Oct 24 15:59:16 2014 +
URL:
http://sources.gentoo.org/gitweb/?p=proj/openrc.git;a=commit;h=e0c32c23
Fix all tests for GNU/kFreeBSD
It is necessary to check for both the kernel and c library because
__FreeBSD_kernel is also defined on native FreeBSD [1].
[1] http://sourceforge.net/p/predef/wiki/OperatingSystems/
---
src/librc/librc-daemon.c | 2 +-
src/librc/rc.h.in| 3 ++-
src/rc/mountinfo.c | 6 --
src/rc/rc-logger.c | 2 +-
src/rc/runscript.c | 3 ++-
5 files changed, 10 insertions(+), 6 deletions(-)
diff --git a/src/librc/librc-daemon.c b/src/librc/librc-daemon.c
index 9970315..d19c3a3 100644
--- a/src/librc/librc-daemon.c
+++ b/src/librc/librc-daemon.c
@@ -30,7 +30,7 @@
#include "librc.h"
-#if defined(__linux__) || defined (__FreeBSD_kernel__)
+#if defined(__linux__) || (defined (__FreeBSD_kernel__) && defined(__GLIBC__))
static bool
pid_is_exec(pid_t pid, const char *exec)
{
diff --git a/src/librc/rc.h.in b/src/librc/rc.h.in
index 34f09f2..fca0dda 100644
--- a/src/librc/rc.h.in
+++ b/src/librc/rc.h.in
@@ -42,7 +42,8 @@ extern "C" {
#define RC_LIBEXECDIR "@LIBEXECDIR@"
#if defined(PREFIX)
#define RC_SVCDIR RC_LIBEXECDIR "/init.d"
-#elif defined(__linux__) || defined(__FreeBSD_kernel__) || defined(__GNU__)
+#elif defined(__linux__) || (defined(__FreeBSD_kernel__) && \
+ defined(__GLIBC__)) || defined(__GNU__)
#define RC_SVCDIR "/run/openrc"
#else
#define RC_SVCDIR RC_LIBEXECDIR "/init.d"
diff --git a/src/rc/mountinfo.c b/src/rc/mountinfo.c
index c4515ae..fbad6af 100644
--- a/src/rc/mountinfo.c
+++ b/src/rc/mountinfo.c
@@ -39,7 +39,8 @@
# include
# define statfs statvfs
# define F_FLAGS f_flag
-#elif defined (__linux__) || defined (__FreeBSD_kernel__) || defined(__GNU__)
+#elif defined (__linux__) || (defined(__FreeBSD_kernel__) && \
+ defined(__GLIBC__)) || defined(__GNU__)
# include
#endif
@@ -265,7 +266,8 @@ find_mounts(struct args *args)
return list;
}
-#elif defined (__linux__) || defined (__FreeBSD_kernel__)
+#elif defined (__linux__) || (defined (__FreeBSD_kernel__) && \
+ defined(__GLIBC__))
static struct mntent *
getmntfile(const char *file)
{
diff --git a/src/rc/rc-logger.c b/src/rc/rc-logger.c
index 50cf618..89eb84b 100644
--- a/src/rc/rc-logger.c
+++ b/src/rc/rc-logger.c
@@ -44,7 +44,7 @@
#include
#include
-#if defined(__linux__) || defined(__FreeBSD_kernel__)
+#if defined(__linux__) || (defined(__FreeBSD_kernel__) && defined(__GLIBC__))
# include
#elif defined(__NetBSD__) || defined(__OpenBSD__)
# include
diff --git a/src/rc/runscript.c b/src/rc/runscript.c
index 96aa683..47ed23e 100644
--- a/src/rc/runscript.c
+++ b/src/rc/runscript.c
@@ -51,7 +51,8 @@
#include
#include
-#if defined(__linux__) || defined(__FreeBSD_kernel__)
+#if defined(__linux__) || (defined(__FreeBSD_kernel__) && \
+ defined(__GLIBC__))
# include
#elif defined(__NetBSD__) || defined(__OpenBSD__)
# include