dexter has submitted this change. ( 
https://gerrit.osmocom.org/c/osmo-e1d/+/32393 )

Change subject: proto_clnt: use osmo_fd_close to close the socket on connection 
loss
......................................................................

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(-)

Approvals:
  pespin: Looks good to me, but someone else must approve
  tnt: Looks good to me, but someone else must approve
  Jenkins Builder: Verified
  laforge: Looks good to me, approved




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 https://gerrit.osmocom.org/c/osmo-e1d/+/32393
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-e1d
Gerrit-Branch: master
Gerrit-Change-Id: I702b944baf2ebbcc84b6a211e245a4a41627bde6
Gerrit-Change-Number: 32393
Gerrit-PatchSet: 3
Gerrit-Owner: dexter <[email protected]>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: dexter <[email protected]>
Gerrit-Reviewer: jolly <[email protected]>
Gerrit-Reviewer: laforge <[email protected]>
Gerrit-Reviewer: pespin <[email protected]>
Gerrit-Reviewer: tnt <[email protected]>
Gerrit-MessageType: merged

Reply via email to