laforge has submitted this change. ( 
https://gerrit.osmocom.org/c/libosmocore/+/35980?usp=email )

 (

5 is the latest approved patch-set.
No files were changed between the latest approved patch-set and the submitted 
one.
 )Change subject: osmo_io_poll: Use -errno as result on read error
......................................................................

osmo_io_poll: Use -errno as result on read error

Related: OS#5751
Change-Id: Ida63b74feecddf96bab7b2ade4e9ad216fe56e06
---
M src/core/osmo_io.c
M src/core/osmo_io_poll.c
2 files changed, 12 insertions(+), 1 deletion(-)

Approvals:
  daniel: Looks good to me, but someone else must approve
  Jenkins Builder: Verified
  pespin: Looks good to me, approved




diff --git a/src/core/osmo_io.c b/src/core/osmo_io.c
index 472edf9..b6b5908 100644
--- a/src/core/osmo_io.c
+++ b/src/core/osmo_io.c
@@ -330,6 +330,7 @@
 /*! 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 52e806d..74f137b 100644
--- a/src/core/osmo_io_poll.c
+++ b/src/core/osmo_io_poll.c
@@ -74,7 +74,7 @@
                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))

--
To view, visit https://gerrit.osmocom.org/c/libosmocore/+/35980?usp=email
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Change-Id: Ida63b74feecddf96bab7b2ade4e9ad216fe56e06
Gerrit-Change-Number: 35980
Gerrit-PatchSet: 8
Gerrit-Owner: jolly <[email protected]>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: daniel <[email protected]>
Gerrit-Reviewer: laforge <[email protected]>
Gerrit-Reviewer: pespin <[email protected]>
Gerrit-MessageType: merged

Reply via email to