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:
Harald Welte 2024-03-07 10:34:21 +01:00
parent 09ab041b42
commit e1d4858277
1 changed files with 2 additions and 2 deletions

View File

@ -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;
}