jolly has uploaded this change for review. (
https://gerrit.osmocom.org/c/libosmocore/+/36200?usp=email )
Change subject: osmo_io_poll: Use -errno as result on write error
......................................................................
osmo_io_poll: Use -errno as result on write error
This was done for read error in a previous patch. This is required
because osmo_io_uring does not support errno, instead it uses the
result code. To have a unified API, set the result code equally.
Related: OS#5751
Change-Id: I405094449a6644db37534757f2fbccbcff982f23
---
M src/core/osmo_io_poll.c
1 file changed, 15 insertions(+), 1 deletion(-)
git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/00/36200/1
diff --git a/src/core/osmo_io_poll.c b/src/core/osmo_io_poll.c
index 2e726d9..fae552c 100644
--- a/src/core/osmo_io_poll.c
+++ b/src/core/osmo_io_poll.c
@@ -84,7 +84,7 @@
struct iofd_msghdr *msghdr = iofd_txqueue_dequeue(iofd);
if (msghdr) {
rc = sendmsg(ofd->fd, &msghdr->hdr, msghdr->flags);
- iofd_handle_send_completion(iofd, rc, msghdr);
+ iofd_handle_send_completion(iofd, (rc < 0 && errno > 0) ? -errno : rc,
msghdr);
} else {
/* Socket is writable, but we have no data to send. A non-blocking/async
connect() is signalled this way. */
--
To view, visit
https://gerrit.osmocom.org/c/libosmocore/+/36200?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: I405094449a6644db37534757f2fbccbcff982f23
Gerrit-Change-Number: 36200
Gerrit-PatchSet: 1
Gerrit-Owner: jolly <andreas(a)eversberg.eu>
Gerrit-MessageType: newchange