From 6257bae23f09420c7988fb04523384f1be475c9e Mon Sep 17 00:00:00 2001 From: mirabilos Date: Fri, 27 Jan 2017 02:02:41 +0100 Subject: [PATCH] Add GNU/kFreeBSD support (#645) * GNU/kFreeBSD is a FreeBSD variant, for code purposes. * GNU/kFreeBSD uses GNU/Linux-ish init scripts, however. --- common/os_calls.c | 4 ++-- configure.ac | 3 +++ sesman/session.c | 2 +- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/common/os_calls.c b/common/os_calls.c index 5db59caa..76685a40 100644 --- a/common/os_calls.c +++ b/common/os_calls.c @@ -87,8 +87,8 @@ extern char **environ; #endif /* sys/ucred.h needs to be included to use struct xucred - * in FreeBSD and OS X. No need for other BSDs */ -#if defined(__FreeBSD__) || defined(__APPLE__) + * in FreeBSD and OS X. No need for other BSDs except GNU/kFreeBSD */ +#if defined(__FreeBSD__) || defined(__APPLE__) || defined(__FreeBSD_kernel__) #include #endif diff --git a/configure.ac b/configure.ac index c7b1d41e..3ad76565 100644 --- a/configure.ac +++ b/configure.ac @@ -28,6 +28,9 @@ case $host_os in *linux*) linux=yes ;; + *kfreebsd*) + linux=yes # only used in instfiles/ so that’s ok for us for now + ;; *freebsd*) freebsd=yes ;; diff --git a/sesman/session.c b/sesman/session.c index cf6f45c4..a672e93e 100644 --- a/sesman/session.c +++ b/sesman/session.c @@ -503,7 +503,7 @@ session_start_fork(tbus data, tui8 type, struct SCP_SESSION *s) g_sprintf(geometry, "%dx%d", s->width, s->height); g_sprintf(depth, "%d", s->bpp); g_sprintf(screen, ":%d", display); -#ifdef __FreeBSD__ +#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) /* * FreeBSD bug * ports/157282: effective login name is not set by xrdp-sesman