aboutsummaryrefslogtreecommitdiffstats
path: root/lib/erl_interface/src/epmd/epmd_publish.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/erl_interface/src/epmd/epmd_publish.c')
-rw-r--r--lib/erl_interface/src/epmd/epmd_publish.c28
1 files changed, 11 insertions, 17 deletions
diff --git a/lib/erl_interface/src/epmd/epmd_publish.c b/lib/erl_interface/src/epmd/epmd_publish.c
index ef8a5d6b70..20b8e867e8 100644
--- a/lib/erl_interface/src/epmd/epmd_publish.c
+++ b/lib/erl_interface/src/epmd/epmd_publish.c
@@ -68,8 +68,7 @@ static int ei_epmd_r4_publish (int port, const char *alive, unsigned ms)
int nlen = strlen(alive);
int len = elen + nlen + 13; /* hard coded: be careful! */
int n;
- int err, response, res;
- unsigned creation;
+ int err, res, creation;
ssize_t dlen;
unsigned tmo = ms == 0 ? EI_SCLBK_INF_TMO : ms;
@@ -125,10 +124,8 @@ static int ei_epmd_r4_publish (int port, const char *alive, unsigned ms)
/* Don't close fd here! It keeps us registered with epmd */
s = buf;
- response = get8(s);
- if (response != EI_EPMD_ALIVE2_RESP &&
- response != EI_EPMD_ALIVE2_X_RESP) {
- EI_TRACE_ERR1("ei_epmd_r4_publish","<- unknown (%d)",response);
+ if (((res=get8(s)) != EI_EPMD_ALIVE2_RESP)) { /* response */
+ EI_TRACE_ERR1("ei_epmd_r4_publish","<- unknown (%d)",res);
EI_TRACE_ERR0("ei_epmd_r4_publish","-> CLOSE");
ei_close__(fd);
erl_errno = EIO;
@@ -144,21 +141,18 @@ static int ei_epmd_r4_publish (int port, const char *alive, unsigned ms)
return -1;
}
- if (response == EI_EPMD_ALIVE2_RESP)
- creation = get16be(s);
- else /* EI_EPMD_ALIVE2_X_RESP */
- creation = get32be(s);
+ creation = get16be(s);
EI_TRACE_CONN2("ei_epmd_r4_publish",
- " result=%d (ok) creation=%u",res,creation);
+ " result=%d (ok) creation=%d",res,creation);
- /*
- * Would be nice to somehow use the nice "unique" creation value
- * received here from epmd instead of using the crappy one
- * passed (already) to ei_connect_init.
- */
+ /* probably should save fd so we can close it later... */
+ /* epmd_saveconn(OPEN,fd,alive); */
- /* return the descriptor */
+ /* return the creation number, for no good reason */
+ /* return creation;*/
+
+ /* no - return the descriptor */
return fd;
}