dexter has uploaded this change for review. ( 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(+), 1 deletion(-)
git pull ssh://gerrit.osmocom.org:29418/osmo-e1d refs/changes/93/32393/1
diff --git a/src/proto_clnt.c b/src/proto_clnt.c index 5b9a467..0a071e8 100644 --- a/src/proto_clnt.c +++ b/src/proto_clnt.c @@ -90,7 +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); + osmo_fd_close(&clnt->ctl_fd); ofd->fd = 0; goto err; }