aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSverker Eriksson <[email protected]>2016-05-17 17:16:13 +0200
committerSverker Eriksson <[email protected]>2016-05-17 17:16:13 +0200
commit045ab524890d79edd34ee67c8557f578b386adfe (patch)
treed93137a639a0b031c19229836009b1255e429320
parent93effe30867d50b68504743cd5f0c851e623932c (diff)
parent3ccd708bc0406c3bf460feb261192179db1dccbd (diff)
downloadotp-045ab524890d79edd34ee67c8557f578b386adfe.tar.gz
otp-045ab524890d79edd34ee67c8557f578b386adfe.tar.bz2
otp-045ab524890d79edd34ee67c8557f578b386adfe.zip
Merge branch 'sverker/runtime_tools/trace_ip_drv/OTP-13576/ERL-119'
-rw-r--r--lib/runtime_tools/c_src/trace_ip_drv.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/lib/runtime_tools/c_src/trace_ip_drv.c b/lib/runtime_tools/c_src/trace_ip_drv.c
index c73630f702..195558f958 100644
--- a/lib/runtime_tools/c_src/trace_ip_drv.c
+++ b/lib/runtime_tools/c_src/trace_ip_drv.c
@@ -374,6 +374,7 @@ static void trace_ip_output(ErlDrvData handle, char *buff, ErlDrvSizeT bufflen)
}
return;
}
+ ASSERT(!IS_INVALID_SOCKET(data->fd));
if (data->que[data->questart] != NULL) {
trace_ip_ready_output(handle, sock2event(data->fd));
}
@@ -412,6 +413,7 @@ static void trace_ip_ready_input(ErlDrvData handle, ErlDrvEvent fd)
/*
** Maybe accept, we are a listen port...
*/
+ ASSERT(IS_INVALID_SOCKET(data->fd));
if (!IS_INVALID_SOCKET((client = my_accept(data->listenfd)))) {
data->fd = client;
set_nonblocking(client);
@@ -735,6 +737,7 @@ static void close_client(TraceIpData *data)
{
my_driver_select(data, data->fd, FLAG_WRITE | FLAG_READ, SELECT_CLOSE);
data->flags |= FLAG_LISTEN_PORT;
+ data->fd = INVALID_SOCKET;
if (!(data->flags & FLAG_FILL_ALWAYS)) {
clean_que(data);
}