Browse code

evapi: detect the OS darwin as substring

- adjust condition to suit analyzer

(cherry picked from commit 81687628bc5fb90a6b126cd2b89c8725a4c3caab)
(cherry picked from commit f23191b8cf85efd5e7cb973608e893b038155a44)
(cherry picked from commit fff4297974f7cfb636a0858278d863c9fdff80aa)

Daniel-Constantin Mierla authored on 21/12/2017 16:07:15
Showing 2 changed files
... ...
@@ -8,9 +8,9 @@ NAME=evapi.so
8 8
 ifeq ($(CROSS_COMPILE),)
9 9
 	BUILDER = $(shell which pkg-config)
10 10
 ifneq ($(BUILDER),)
11
-		PKGLIBUV = $(shell $(BUILDER) --exists libev > /dev/null 2>&1 ; echo $$? )
11
+	PKGLIBUV = $(shell $(BUILDER) --exists libev > /dev/null 2>&1 ; echo $$? )
12 12
 ifneq ($(PKGLIBUV),0)
13
-			BUILDER =
13
+	BUILDER =
14 14
 endif
15 15
 endif
16 16
 endif
... ...
@@ -19,13 +19,14 @@ ifneq ($(BUILDER),)
19 19
 	DEFS += $(shell $(BUILDER) --cflags libev)
20 20
 	LIBS += $(shell $(BUILDER) --libs libev)
21 21
 else
22
-ifeq ($(OS), darwin)
23
-	DEFS += -I/opt/local/include
24
-	LIBS += -L/opt/local/lib
25
-endif
22
+ifneq (,$(findstring darwin,$(OS)))
23
+	DEFS += -I/opt/local/include -I$(LOCALBASE)/include
24
+	LIBS += -L/opt/local/lib -L$(LOCALBASE)/lib -lev
25
+else
26 26
 	DEFS += -I$(LOCALBASE)/include -I$(SYSBASE)/include
27 27
 	LIBS += -L$(LOCALBASE)/lib -L$(SYSBASE)/lib -lev
28 28
 endif
29
+endif
29 30
 
30 31
 
31 32
 DEFS+=-DKAMAILIO_MOD_INTERFACE
... ...
@@ -444,7 +444,7 @@ void evapi_accept_client(struct ev_loop *loop, struct ev_io *watcher, int revent
444 444
 			break;
445 445
 		}
446 446
 	}
447
-	if(i==EVAPI_MAX_CLIENTS) {
447
+	if(i>=EVAPI_MAX_CLIENTS) {
448 448
 		LM_ERR("too many clients\n");
449 449
 		close(csock);
450 450
 		free(evapi_client);