From 2edd83dac10ea80e199fefb71a46e8dd13b39f0c Mon Sep 17 00:00:00 2001 From: Andy Green Date: Sun, 9 Aug 2020 08:09:46 +0100 Subject: [PATCH] freebsd: sai build adaptations --- include/libwebsockets.h | 4 ++++ lib/plat/unix/unix-spawn.c | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/include/libwebsockets.h b/include/libwebsockets.h index c60b87dcc..544a9db5d 100644 --- a/include/libwebsockets.h +++ b/include/libwebsockets.h @@ -147,6 +147,10 @@ typedef unsigned long long lws_intptr_t; #endif #endif +#if defined(__FreeBSD__) +#include +#endif + #if defined(__GNUC__) /* warn_unused_result attribute only supported by GCC 3.4 or later */ diff --git a/lib/plat/unix/unix-spawn.c b/lib/plat/unix/unix-spawn.c index 9d2d20759..894a17186 100644 --- a/lib/plat/unix/unix-spawn.c +++ b/lib/plat/unix/unix-spawn.c @@ -435,7 +435,11 @@ lws_spawn_piped(const struct lws_spawn_piped_info *i) if (lsp->info.disable_ctrlc) /* stops non-daemonized main processess getting SIGINT * from TTY */ +#if defined(__FreeBSD__) + setpgid(0, 0); +#else setpgrp(); +#endif if (lsp->child_pid) {