msuraev submitted this change.
Better handling of send() error
Avoid logging confusion when -1 == ENOTSUP.
Change-Id: Iaa7e16e717c56466c5d9a64deb438776ca88022e
---
M src/stream.c
1 file changed, 5 insertions(+), 4 deletions(-)
diff --git a/src/stream.c b/src/stream.c
index 8cb3ad0..7b41ce1 100644
--- a/src/stream.c
+++ b/src/stream.c
@@ -1328,11 +1328,12 @@
}
break;
default:
- ret = -ENOTSUP;
+ ret = -1;
+ errno = ENOTSUP;
}
- if (ret < 0) { /* send(): On error , -1 is returned, and errno is set appropriately */
- LOGP(DLINP, LOGL_ERROR, "error to send: %s\n", (ret == -1) ? strerror(errno) : strerror(-ret));
- }
+ if (ret == -1) /* send(): On error -1 is returned, and errno is set appropriately */
+ LOGP(DLINP, LOGL_ERROR, "error to send: %s\n", strerror(errno));
+
msgb_free(msg);
if (llist_empty(&conn->tx_queue) && (conn->flags & OSMO_STREAM_SRV_F_FLUSH_DESTROY))
To view, visit change 29555. To unsubscribe, or for help writing mail filters, visit settings.