aboutsummaryrefslogtreecommitdiffstats
path: root/lib/erl_interface/src/prog
diff options
context:
space:
mode:
authorDeepak Goel <[email protected]>2017-02-15 15:13:38 -0800
committerDeepak Goel <[email protected]>2017-03-22 15:42:22 -0700
commit3fcf58b142e22adb754b312576570c904655f877 (patch)
tree5e0630d7ca5b6544f2d1db3c66b2a26a70f2f85e /lib/erl_interface/src/prog
parentaa315e1cf1b79ab782e5b4c944595495ebf4e2f4 (diff)
downloadotp-3fcf58b142e22adb754b312576570c904655f877.tar.gz
otp-3fcf58b142e22adb754b312576570c904655f877.tar.bz2
otp-3fcf58b142e22adb754b312576570c904655f877.zip
This patch fixes the issue in which erlang fails to start
if the hostname is 64 characters on a linux system.
Diffstat (limited to 'lib/erl_interface/src/prog')
-rw-r--r--lib/erl_interface/src/prog/erl_call.c3
1 files changed, 2 insertions, 1 deletions
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);
}