diff --git a/src/core/osmo_io.c b/src/core/osmo_io.c index 37b4cf069..5f49669fd 100644 --- a/src/core/osmo_io.c +++ b/src/core/osmo_io.c @@ -328,6 +328,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 ff4cc19bb..cacbfd8d6 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))