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/
This commit is contained in:
William Hubbs 2014-10-23 18:47:04 -05:00
parent 4ac289b539
commit ca6b86be44
5 changed files with 10 additions and 6 deletions

View File

@ -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)
{

View File

@ -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"

View File

@ -39,7 +39,8 @@
# include <sys/statvfs.h>
# 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 <mntent.h>
#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)
{

View File

@ -44,7 +44,7 @@
#include <time.h>
#include <unistd.h>
#if defined(__linux__) || defined(__FreeBSD_kernel__)
#if defined(__linux__) || (defined(__FreeBSD_kernel__) && defined(__GLIBC__))
# include <pty.h>
#elif defined(__NetBSD__) || defined(__OpenBSD__)
# include <util.h>

View File

@ -51,7 +51,8 @@
#include <time.h>
#include <unistd.h>
#if defined(__linux__) || defined(__FreeBSD_kernel__)
#if defined(__linux__) || (defined(__FreeBSD_kernel__) && \
defined(__GLIBC__))
# include <pty.h>
#elif defined(__NetBSD__) || defined(__OpenBSD__)
# include <util.h>