diff options
author | Lukas Larsson <[email protected]> | 2017-03-30 10:36:30 +0200 |
---|---|---|
committer | Lukas Larsson <[email protected]> | 2017-03-30 10:36:30 +0200 |
commit | 5da9e0ab5cb96f2cb37e534b2c1a55c0c2c9783c (patch) | |
tree | 2c5149e87daeaa23500bb94918f77fe25c7e2637 /lib/erl_interface/src/prog | |
parent | 53b483cb14c4b3b666eab63f9f09d7ac827f9a7c (diff) | |
parent | 3fcf58b142e22adb754b312576570c904655f877 (diff) | |
download | otp-5da9e0ab5cb96f2cb37e534b2c1a55c0c2c9783c.tar.gz otp-5da9e0ab5cb96f2cb37e534b2c1a55c0c2c9783c.tar.bz2 otp-5da9e0ab5cb96f2cb37e534b2c1a55c0c2c9783c.zip |
Merge branch 'goeldeepak/erts/fix_inet_gethost_long/ERL-61/PR-1345/OTP-14310'
* goeldeepak/erts/fix_inet_gethost_long/ERL-61/PR-1345/OTP-14310:
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.c | 3 |
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); } |