From d443097778e22c51173aaa22b71303b05a89cf84 Mon Sep 17 00:00:00 2001 From: Rickard Green Date: Mon, 28 Jan 2019 14:39:17 +0100 Subject: Fix build of erl_interface on BSD --- lib/erl_interface/src/misc/ei_portio.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'lib/erl_interface/src/misc') diff --git a/lib/erl_interface/src/misc/ei_portio.c b/lib/erl_interface/src/misc/ei_portio.c index 726b1af82d..368c56546b 100644 --- a/lib/erl_interface/src/misc/ei_portio.c +++ b/lib/erl_interface/src/misc/ei_portio.c @@ -19,6 +19,9 @@ * */ + +#include "eidef.h" + #ifdef __WIN32__ #include #include @@ -47,10 +50,8 @@ static unsigned long param_one = 1; #include #include #include -#include #include #include -#include #include #include #include @@ -65,7 +66,6 @@ static unsigned long param_one = 1; #else /* other unix */ #include -#include #include #include #include @@ -86,6 +86,7 @@ static unsigned long param_one = 1; /* common includes */ +#include #include #include #include @@ -94,7 +95,9 @@ static unsigned long param_one = 1; #else #include #endif -#include "eidef.h" +#ifdef HAVE_SYS_SELECT_H +#include +#endif #include "ei_portio.h" #include "ei_internal.h" -- cgit v1.2.3 From 50bf9f5d8403b9903ea63867611ac16ffec1c14c Mon Sep 17 00:00:00 2001 From: Rickard Green Date: Tue, 29 Jan 2019 16:58:13 +0100 Subject: Fix bug in ei_accept_tmo --- lib/erl_interface/src/misc/ei_portio.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib/erl_interface/src/misc') diff --git a/lib/erl_interface/src/misc/ei_portio.c b/lib/erl_interface/src/misc/ei_portio.c index 368c56546b..bccc86c1b1 100644 --- a/lib/erl_interface/src/misc/ei_portio.c +++ b/lib/erl_interface/src/misc/ei_portio.c @@ -249,7 +249,7 @@ static int tcp_accept(void **ctx, void *addr, int *len, unsigned unused) if (res) return res; - res = accept(fd, (struct sockaddr*) &addr, &addr_len); + res = accept(fd, (struct sockaddr*) addr, &addr_len); if (MEANS_SOCKET_ERROR(res)) return get_error(); -- cgit v1.2.3 From dbeaca78bc6c0d4719a522e447fa59d7a1006ae0 Mon Sep 17 00:00:00 2001 From: Rickard Green Date: Tue, 5 Feb 2019 15:55:23 +0100 Subject: Introduce ei_init() You previously had to initialize ei via erl_init() which implied that you were forced to link against the erl_interface even when not using it (besides initializing ei). --- lib/erl_interface/src/misc/ei_init.c | 32 ++++++++++++++++++++++++++++++++ lib/erl_interface/src/misc/ei_internal.h | 2 ++ 2 files changed, 34 insertions(+) create mode 100644 lib/erl_interface/src/misc/ei_init.c (limited to 'lib/erl_interface/src/misc') diff --git a/lib/erl_interface/src/misc/ei_init.c b/lib/erl_interface/src/misc/ei_init.c new file mode 100644 index 0000000000..5357968657 --- /dev/null +++ b/lib/erl_interface/src/misc/ei_init.c @@ -0,0 +1,32 @@ +/* + * %CopyrightBegin% + * + * Copyright Ericsson AB 2019. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * %CopyrightEnd% + */ + +#include "ei.h" +#include "ei_resolve.h" +#include "ei_internal.h" + +int +ei_init(void) +{ + int error = ei_init_connect(); + if (error) + return error; + return ei_init_resolve(); +} diff --git a/lib/erl_interface/src/misc/ei_internal.h b/lib/erl_interface/src/misc/ei_internal.h index 0c58245c0a..f28dd6d668 100644 --- a/lib/erl_interface/src/misc/ei_internal.h +++ b/lib/erl_interface/src/misc/ei_internal.h @@ -153,6 +153,8 @@ extern int ei_tracelevel; +int ei_init_connect(void); + void ei_trace_printf(const char *name, int level, const char *format, ...); int ei_internal_use_r9_pids_ports(void); -- cgit v1.2.3