aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorPhilipp Maier <pmaier@sysmocom.de>2023-04-20 17:21:59 +0200
committerPhilipp Maier <pmaier@sysmocom.de>2023-05-02 15:36:20 +0200
commit580bb374aec0c3c4171c7dce06725c6c3fd6613f (patch)
tree6d3c0749e3d086bf6395303f95f72eeac03a51bf /src
parentdaaa2fedcbd42841ecc4731586fe6e280c044584 (diff)
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
Diffstat (limited to 'src')
-rw-r--r--src/proto_clnt.c3
1 files changed, 1 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 @@ _e1dp_client_read(struct osmo_fd *ofd, unsigned int flags)
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;
}