diff --git a/src/modules/evapi/Makefile b/src/modules/evapi/Makefile index fa3e3fe515e..7df0976d9b5 100644 --- a/src/modules/evapi/Makefile +++ b/src/modules/evapi/Makefile @@ -8,9 +8,9 @@ NAME=evapi.so ifeq ($(CROSS_COMPILE),) BUILDER = $(shell which pkg-config) ifneq ($(BUILDER),) - PKGLIBUV = $(shell $(BUILDER) --exists libev > /dev/null 2>&1 ; echo $$? ) + PKGLIBUV = $(shell $(BUILDER) --exists libev > /dev/null 2>&1 ; echo $$? ) ifneq ($(PKGLIBUV),0) - BUILDER = + BUILDER = endif endif endif @@ -19,13 +19,14 @@ ifneq ($(BUILDER),) DEFS += $(shell $(BUILDER) --cflags libev) LIBS += $(shell $(BUILDER) --libs libev) else -ifeq ($(OS), darwin) - DEFS += -I/opt/local/include - LIBS += -L/opt/local/lib -endif +ifneq (,$(findstring darwin,$(OS))) + DEFS += -I/opt/local/include -I$(LOCALBASE)/include + LIBS += -L/opt/local/lib -L$(LOCALBASE)/lib -lev +else DEFS += -I$(LOCALBASE)/include -I$(SYSBASE)/include LIBS += -L$(LOCALBASE)/lib -L$(SYSBASE)/lib -lev endif +endif DEFS+=-DKAMAILIO_MOD_INTERFACE diff --git a/src/modules/evapi/evapi_dispatch.c b/src/modules/evapi/evapi_dispatch.c index 34e733c8851..fee0cc8c270 100644 --- a/src/modules/evapi/evapi_dispatch.c +++ b/src/modules/evapi/evapi_dispatch.c @@ -552,7 +552,7 @@ void evapi_accept_client(struct ev_loop *loop, struct ev_io *watcher, int revent break; } } - if(i==EVAPI_MAX_CLIENTS) { + if(i>=EVAPI_MAX_CLIENTS) { LM_ERR("too many clients\n"); close(csock); free(evapi_client);