Commit 7dea2f3b authored by Lucas Russo's avatar Lucas Russo

libs/llio/*/ll_io_eth.c: fix wrong closing of FD

The correct place t destroy it is in
eth_release (), as we assign it in
eth_open ()
parent 60942363
......@@ -111,7 +111,6 @@ static llio_err_e llio_dev_eth_destroy (llio_dev_eth_t **self_p)
if (*self_p) {
llio_dev_eth_t *self = *self_p;
close (self->fd);
free (self->hostname);
free (self->port);
free (self);
......@@ -230,6 +229,11 @@ static int eth_release (llio_t *self, llio_endpoint_t *endpoint)
ASSERT_TEST(dev_eth != NULL, "Could not get ETH handler",
err_dev_eth_handler, -1);
/* First destroy the FD handling the socket. This FD
* is initialized on eth_open (), so the proper place to
* destroy it is here, not on llio_dev_eth_destroy () */
close (dev_eth->fd);
/* Deattach specific device handler to generic one */
lerr = llio_dev_eth_destroy (&dev_eth);
ASSERT_TEST (lerr==LLIO_SUCCESS, "Could not close device appropriately",
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment