From 26e25647a0c650a30aecffb0c44973f1952b4f29 Mon Sep 17 00:00:00 2001 From: twosky2000 Date: Mon, 5 Sep 2016 20:02:46 +0200 Subject: [PATCH] Fix compiling under TrueOS 12-Current BSD has the getgrouplist function in unistd, even it's may not on every BSD the same. https://www.freebsd.org/cgi/man.cgi?query=getgrouplist&sektion=3&apropos=0&manpath=freebsd Tested with TrueOS-Server-2016-08-31-x64 --- src/userid.cc | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/userid.cc b/src/userid.cc index dd8b0c4..44e186e 100644 --- a/src/userid.cc +++ b/src/userid.cc @@ -6,7 +6,13 @@ #include #include #include - +#if defined(__unix__) || (defined(__APPLE__) && defined(__MACH__)) +#include +#if defined(BSD) + /* BSD needs unistd.h for getgrouplist function*/ +#include +#endif +#endif #include using v8::FunctionTemplate;