From 3fcf58b142e22adb754b312576570c904655f877 Mon Sep 17 00:00:00 2001 From: Deepak Goel Date: Wed, 15 Feb 2017 15:13:38 -0800 Subject: This patch fixes the issue in which erlang fails to start if the hostname is 64 characters on a linux system. --- lib/erl_interface/src/prog/erl_call.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'lib/erl_interface/src/prog') diff --git a/lib/erl_interface/src/prog/erl_call.c b/lib/erl_interface/src/prog/erl_call.c index d233ed26a2..0b09d412db 100644 --- a/lib/erl_interface/src/prog/erl_call.c +++ b/lib/erl_interface/src/prog/erl_call.c @@ -325,7 +325,8 @@ int erl_call(int argc, char **argv) initWinSock(); #endif - if (gethostname(h_hostname, EI_MAXHOSTNAMELEN) < 0) { + /* gethostname requires len to be max(hostname) + 1 */ + if (gethostname(h_hostname, EI_MAXHOSTNAMELEN+1) < 0) { fprintf(stderr,"erl_call: failed to get host name: %d\n", errno); exit(1); } -- cgit v1.2.3