aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFredrik Gustafsson <[email protected]>2013-05-16 10:00:09 +0200
committerFredrik Gustafsson <[email protected]>2013-05-16 10:00:09 +0200
commitd7e9fafa45eb96e3c34e24f03476a42e474701f0 (patch)
treed5cb21f142f12ddd9cf4f2f1bc761230d7d02fc2
parent0bd39fcb975b98ff03267b5c6950f242b19adc75 (diff)
parentf1e3a92a13c1e58c3cb83c995af2bc5f09b512cb (diff)
downloadotp-d7e9fafa45eb96e3c34e24f03476a42e474701f0.tar.gz
otp-d7e9fafa45eb96e3c34e24f03476a42e474701f0.tar.bz2
otp-d7e9fafa45eb96e3c34e24f03476a42e474701f0.zip
Merge branch 'fredrik/close_socket_ei' into maint
* fredrik/close_socket_ei: erl_interface: check if file descriptor is valid before closing
-rw-r--r--lib/erl_interface/src/connect/ei_connect.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/erl_interface/src/connect/ei_connect.c b/lib/erl_interface/src/connect/ei_connect.c
index 3ab86bb340..8f1f231b82 100644
--- a/lib/erl_interface/src/connect/ei_connect.c
+++ b/lib/erl_interface/src/connect/ei_connect.c
@@ -830,7 +830,8 @@ int ei_accept_tmo(ei_cnode* ec, int lfd, ErlConnect *conp, unsigned ms)
error:
EI_TRACE_ERR0("ei_accept","<- ACCEPT failed");
- closesocket(fd);
+ if (fd>=0)
+ closesocket(fd);
return ERL_ERROR;
} /* ei_accept */