mirror of https://gerrit.osmocom.org/libosmocore
osmo_io: Don't pretend to support backends without close_cb
Let's not pretend we support backends without a close_cb. In such situations nobody would actually close(2) the file descriptor, but we would set iofd->fd to -1, effectively creating a file descriptor leak. Both of our two back-ends provide a close_cb, and we don't need to consider hypothetical future back-ends that would not like to register such a call-back. Related: OS#6393 Change-Id: Id285f1d7b73ae5805aa618897016ae8b73bf892d
This commit is contained in:
parent
09ab041b42
commit
e1d4858277
|
@ -787,8 +787,8 @@ int osmo_iofd_close(struct osmo_io_fd *iofd)
|
|||
|
||||
iofd->pending = NULL;
|
||||
|
||||
if (osmo_iofd_ops.close)
|
||||
rc = osmo_iofd_ops.close(iofd);
|
||||
OSMO_ASSERT(osmo_iofd_ops.close);
|
||||
rc = osmo_iofd_ops.close(iofd);
|
||||
iofd->fd = -1;
|
||||
return rc;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue