dexter submitted this change.
proto_clnt: use osmo_fd_close to close the socket on connection loss
When the socket is closed due to a connection loss, we currently use
close(). This is not enough since this will not remove the file
descriptor from the select loop. Let's use osmo_fd_close.
Related: OS#5983
Change-Id: I702b944baf2ebbcc84b6a211e245a4a41627bde6
---
M src/proto_clnt.c
1 file changed, 15 insertions(+), 2 deletions(-)
diff --git a/src/proto_clnt.c b/src/proto_clnt.c
index 5b9a467..6c59593 100644
--- a/src/proto_clnt.c
+++ b/src/proto_clnt.c
@@ -90,8 +90,7 @@
msgb = osmo_e1dp_recv(ofd, NULL);
if (!msgb) {
LOGP(DE1D, LOGL_ERROR, "Lost connection with osmo-e1d control socket.\n");
- close(ofd->fd);
- ofd->fd = 0;
+ osmo_fd_close(&clnt->ctl_fd);
goto err;
}
To view, visit change 32393. To unsubscribe, or for help writing mail filters, visit settings.