laforge has uploaded this change for review. ( https://gerrit.osmocom.org/c/libosmocore/+/36190?usp=email )
Change subject: osmo_io: Log error message in case call-backs incompatible with mode ......................................................................
osmo_io: Log error message in case call-backs incompatible with mode
Change-Id: I50ba6a76c0144f249d67488874a6c4edf01ec6f2 --- M src/core/osmo_io.c 1 file changed, 16 insertions(+), 2 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/90/36190/1
diff --git a/src/core/osmo_io.c b/src/core/osmo_io.c index c1d206b..0631364 100644 --- a/src/core/osmo_io.c +++ b/src/core/osmo_io.c @@ -619,8 +619,11 @@ return NULL; }
- if (ioops && !check_mode_callback_compat(mode, ioops)) + if (ioops && !check_mode_callback_compat(mode, ioops)) { + LOGP(DLIO, LOGL_ERROR, "iofd(%s): rejecting call-backs incompatible with mode\n", + name ? name : "unknown"); return NULL; + }
iofd = talloc_zero(ctx, struct osmo_io_fd); if (!iofd) @@ -875,8 +878,10 @@ * \param[in] ioops osmo_io_ops structure to be set */ int osmo_iofd_set_ioops(struct osmo_io_fd *iofd, const struct osmo_io_ops *ioops) { - if (!check_mode_callback_compat(iofd->mode, ioops)) + if (!check_mode_callback_compat(iofd->mode, ioops)) { + LOGPIO(iofd, LOGL_ERROR, "rejecting call-backs incompatible with mode\n"); return -EINVAL; + }
iofd->io_ops = *ioops;