diff options
author | Sverker Eriksson <[email protected]> | 2016-05-10 20:16:49 +0200 |
---|---|---|
committer | Sverker Eriksson <[email protected]> | 2016-05-10 20:16:49 +0200 |
commit | 3ccd708bc0406c3bf460feb261192179db1dccbd (patch) | |
tree | 1065474c919be2a7ead88525e870f39b5d381252 /lib/runtime_tools/c_src | |
parent | af87b1c3d4897840d8247589a88d3611106ecedc (diff) | |
download | otp-3ccd708bc0406c3bf460feb261192179db1dccbd.tar.gz otp-3ccd708bc0406c3bf460feb261192179db1dccbd.tar.bz2 otp-3ccd708bc0406c3bf460feb261192179db1dccbd.zip |
runtime_tools: Fix bug in trace_ip_drv
causing extra calls to driver_select(,, _|ERL_DRV_USE, 0)
reporting "... (re)selected before stop_select was called"
Solution:
Set data->fd to INVALID to avoid double call to close_client()
in close_inlink_port().
Diffstat (limited to 'lib/runtime_tools/c_src')
-rw-r--r-- | lib/runtime_tools/c_src/trace_ip_drv.c | 3 |
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 a7d132ca6e..ab5a2d429d 100644 --- a/lib/runtime_tools/c_src/trace_ip_drv.c +++ b/lib/runtime_tools/c_src/trace_ip_drv.c @@ -384,6 +384,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)); } @@ -422,6 +423,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); @@ -745,6 +747,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); } |