pespin has uploaded this change for review. ( https://gerrit.osmocom.org/c/libosmocore/+/39065?usp=email )
Change subject: osmo_io: Simplify early return path ......................................................................
osmo_io: Simplify early return path
Change-Id: I985077cc0e2c11c4b6937f7e0f9bca61518716e0 --- M src/core/osmo_io.c 1 file changed, 2 insertions(+), 3 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/65/39065/1
diff --git a/src/core/osmo_io.c b/src/core/osmo_io.c index 9c93e25..bff86d2 100644 --- a/src/core/osmo_io.c +++ b/src/core/osmo_io.c @@ -736,13 +736,12 @@ { int rc = 0;
- if (fd >= 0) - iofd->fd = fd; - else if (iofd->fd < 0) { + if (iofd->fd < 0) { /* this might happen if both osmo_iofd_setup() and osmo_iofd_register() are called with -1 */ LOGPIO(iofd, LOGL_ERROR, "Cannot register io_fd using invalid fd == %d\n", iofd->fd); return -EBADF; } + iofd->fd = fd;
rc = osmo_iofd_ops.register_fd(iofd); if (rc)