Permalink
Browse files

macosx: fix compile errors

  • Loading branch information...
msantos committed Apr 12, 2018
1 parent 2bd4f8f commit bd7199ea317ab0d0fdba39d188381b5ed1f03ff6
Showing with 4 additions and 5 deletions.
  1. +2 −3 c_src/Makefile
  2. +2 −2 c_src/epcap_priv.c
View
@@ -18,9 +18,8 @@ C_SRC_OUTPUT ?= $(CURDIR)/../priv/$(PROJECT)
UNAME_SYS := $(shell uname -s)
ifeq ($(UNAME_SYS), Darwin)
CC ?= cc
- CFLAGS ?= -O3 -arch x86_64 -finline-functions -Wall -Wmissing-prototypes
- CXXFLAGS ?= -O3 -arch x86_64 -finline-functions -Wall
- LDFLAGS ?= -arch x86_64 -flat_namespace -undefined suppress
+ LDFLAGS ?= -Wno-missing-braces
+ CFLAGS ?= -D_FORTIFY_SOURCE=2 -O2 -fstack-protector-strong -Wformat -Werror=format-security -fno-strict-aliasing
else ifeq ($(UNAME_SYS), FreeBSD)
CC ?= cc
LDFLAGS ?= -Wl,-Bsymbolic-functions -Wl,-z,relro,-z,now
View
@@ -66,7 +66,7 @@ epcap_priv_drop(EPCAP_STATE *ep)
gid = ep->group ? gr->gr_gid : pw->pw_gid;
-#if defined(__sunos__)
+#if defined(__sunos__) || defined(__APPLE__)
if (setgid(gid) < 0)
return -1;
@@ -99,7 +99,7 @@ epcap_priv_runasuser(EPCAP_STATE *ep)
if (setgroups(0, NULL) < 0)
return -1;
-#if defined(__sunos__)
+#if defined(__sunos__) || defined(__APPLE__)
if (setgid(getgid()) < 0)
return -1;

0 comments on commit bd7199e

Please sign in to comment.