diff --git a/src/core/osmo_io.c b/src/core/osmo_io.c index 472edf9f5..b6b590877 100644 --- a/src/core/osmo_io.c +++ b/src/core/osmo_io.c @@ -330,6 +330,7 @@ void iofd_handle_segmented_read(struct osmo_io_fd *iofd, struct msgb *msg, int r /*! completion handler: Called by osmo_io backend after a given I/O operation has completed * \param[in] iofd I/O file-descriptor on which I/O has completed * \param[in] msg message buffer containing data related to completed I/O + * \param[in] rc result code with read size or error (-errno) * \param[in] hdr serialized msghdr containing state of completed I/O */ void iofd_handle_recv(struct osmo_io_fd *iofd, struct msgb *msg, int rc, struct iofd_msghdr *hdr) { diff --git a/src/core/osmo_io_poll.c b/src/core/osmo_io_poll.c index 52e806d2d..74f137b06 100644 --- a/src/core/osmo_io_poll.c +++ b/src/core/osmo_io_poll.c @@ -74,7 +74,7 @@ static void iofd_poll_ofd_cb_recvmsg_sendmsg(struct osmo_fd *ofd, unsigned int w if (rc > 0) msgb_put(msg, rc); - iofd_handle_recv(iofd, msg, rc, &hdr); + iofd_handle_recv(iofd, msg, (rc < 0 && errno > 0) ? -errno : rc, &hdr); } if (IOFD_FLAG_ISSET(iofd, IOFD_FLAG_CLOSED))