laforge has submitted this change. ( https://gerrit.osmocom.org/c/libosmo-netif/+/29178 )
Change subject: Properly handle send() return code ......................................................................
Properly handle send() return code
Change-Id: If9b80e855b740254d5414ea50b4ce594855da8e9 --- M src/stream.c 1 file changed, 2 insertions(+), 2 deletions(-)
Approvals: Jenkins Builder: Verified fixeria: Looks good to me, but someone else must approve laforge: Looks good to me, approved
diff --git a/src/stream.c b/src/stream.c index dc44a1c..a7053e9 100644 --- a/src/stream.c +++ b/src/stream.c @@ -1330,8 +1330,8 @@ default: ret = -ENOTSUP; } - if (ret < 0) { - LOGP(DLINP, LOGL_ERROR, "error to send: %s\n", strerror(-ret)); + 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)); } msgb_free(msg);