[gentoo-commits] proj/openrc:openrc-0.13.x commit in: src/rc/, src/librc/

2014-10-24 Thread William Hubbs
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 



[gentoo-commits] proj/openrc:openrc-0.13.x commit in: src/rc/, src/librc/

2014-10-24 Thread William Hubbs
commit: 5f23128f303b98ec882a3afaf7d98087f452a938
Author: Svante Signell  gmail  com>
AuthorDate: Tue Oct 21 06:53:37 2014 +
Commit: William Hubbs  gentoo  org>
CommitDate: Fri Oct 24 15:59:15 2014 +
URL:
http://sources.gentoo.org/gitweb/?p=proj/openrc.git;a=commit;h=5f23128f

Fix GNU/kFreeBSD port

Check for __FreeBSD_kernel instead of __GLIBC__ in source files.

note from William Hubbs:
I was told this is a better check for GNU/kFreeBSD than checking the
C  library the source is being compiled against.
GNU/kFreeBSD than checking which library we are using.

---
 src/librc/librc-daemon.c | 2 +-
 src/rc/mountinfo.c   | 4 ++--
 src/rc/rc-logger.c   | 2 +-
 src/rc/runscript.c   | 2 +-
 4 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/src/librc/librc-daemon.c b/src/librc/librc-daemon.c
index 04f25b1..9970315 100644
--- a/src/librc/librc-daemon.c
+++ b/src/librc/librc-daemon.c
@@ -30,7 +30,7 @@
 
 #include "librc.h"
 
-#if defined(__linux__) || defined (__GLIBC__)
+#if defined(__linux__) || defined (__FreeBSD_kernel__)
 static bool
 pid_is_exec(pid_t pid, const char *exec)
 {

diff --git a/src/rc/mountinfo.c b/src/rc/mountinfo.c
index ce3f27d..7840987 100644
--- a/src/rc/mountinfo.c
+++ b/src/rc/mountinfo.c
@@ -39,7 +39,7 @@
 #  include 
 #  define statfs statvfs
 #  define F_FLAGS f_flag
-#elif defined (__linux__) || defined (__GLIBC__)
+#elif defined (__linux__) || defined (__FreeBSD_kernel__)
 #  include 
 #endif
 
@@ -265,7 +265,7 @@ find_mounts(struct args *args)
return list;
 }
 
-#elif defined (__linux__) || defined (__GLIBC__)
+#elif defined (__linux__) || defined (__FreeBSD_kernel__)
 static struct mntent *
 getmntfile(const char *file)
 {

diff --git a/src/rc/rc-logger.c b/src/rc/rc-logger.c
index e8fb0ff..50cf618 100644
--- a/src/rc/rc-logger.c
+++ b/src/rc/rc-logger.c
@@ -44,7 +44,7 @@
 #include 
 #include 
 
-#if defined(__linux__) || defined(__GLIBC__)
+#if defined(__linux__) || defined(__FreeBSD_kernel__)
 #  include 
 #elif defined(__NetBSD__) || defined(__OpenBSD__)
 #  include 

diff --git a/src/rc/runscript.c b/src/rc/runscript.c
index de18f90..96aa683 100644
--- a/src/rc/runscript.c
+++ b/src/rc/runscript.c
@@ -51,7 +51,7 @@
 #include 
 #include 
 
-#if defined(__linux__) || defined(__GLIBC__)
+#if defined(__linux__) || defined(__FreeBSD_kernel__)
 #  include 
 #elif defined(__NetBSD__) || defined(__OpenBSD__)
 #  include