mirror of https://gerrit.osmocom.org/libosmocore
osmo_io: Assert that iofd mode is correct when calling *_write_msgb
Change-Id: Ief82ba7f9b280f85d66d68c358c36ba9866fe47a Fixes: OS#6264
This commit is contained in:
parent
459cb06912
commit
afdfc6a034
|
@ -356,6 +356,7 @@ int osmo_iofd_write_msgb(struct osmo_io_fd *iofd, struct msgb *msg)
|
|||
{
|
||||
int rc;
|
||||
|
||||
OSMO_ASSERT(iofd->mode == OSMO_IO_FD_MODE_READ_WRITE);
|
||||
if (OSMO_UNLIKELY(!iofd->io_ops.write_cb)) {
|
||||
LOGPIO(iofd, LOGL_ERROR, "write_cb not set, Rejecting msgb\n");
|
||||
return -EINVAL;
|
||||
|
|
Loading…
Reference in New Issue