From 438492843cef24af9b7c05426e7bfbf0662df4a1 Mon Sep 17 00:00:00 2001 From: Michael Scott Date: Wed, 1 Mar 2017 23:15:17 -0800 Subject: net/mqtt: return error codes from net_context_send Instead of returning EIO let's bubble the error from net_context_send back up to the caller in the following functions: mqtt_tx_connect() mqtt_tx_disconnect() mqtt_tx_pub_msgs() mqtt_tx_publish() mqtt_tx_pingreq() mqtt_tx_subscribe() mqtt_tx_unsubscribe() Change-Id: I9bb4396b227b8902ac1195a97bc37eb1959b643e Signed-off-by: Michael Scott --- subsys/net/lib/mqtt/mqtt.c | 7 ------- 1 file changed, 7 deletions(-) diff --git a/subsys/net/lib/mqtt/mqtt.c b/subsys/net/lib/mqtt/mqtt.c index c7f37f869..bbfb69831 100644 --- a/subsys/net/lib/mqtt/mqtt.c +++ b/subsys/net/lib/mqtt/mqtt.c @@ -53,7 +53,6 @@ int mqtt_tx_connect(struct mqtt_ctx *ctx, struct mqtt_connect_msg *msg) rc = net_context_send(tx, NULL, ctx->net_timeout, NULL, NULL); if (rc < 0) { - rc = -EIO; net_pkt_unref(tx); } @@ -93,7 +92,6 @@ int mqtt_tx_disconnect(struct mqtt_ctx *ctx) rc = net_context_send(tx, NULL, ctx->net_timeout, NULL, NULL); if (rc < 0) { - rc = -EIO; goto exit_disconnect; } @@ -167,7 +165,6 @@ int mqtt_tx_pub_msgs(struct mqtt_ctx *ctx, u16_t id, rc = net_context_send(tx, NULL, ctx->net_timeout, NULL, NULL); if (rc < 0) { - rc = -EIO; goto exit_send; } @@ -229,7 +226,6 @@ int mqtt_tx_publish(struct mqtt_ctx *ctx, struct mqtt_publish_msg *msg) rc = net_context_send(tx, NULL, ctx->net_timeout, NULL, NULL); if (rc < 0) { - rc = -EIO; net_pkt_unref(tx); } @@ -268,7 +264,6 @@ int mqtt_tx_pingreq(struct mqtt_ctx *ctx) rc = net_context_send(tx, NULL, ctx->net_timeout, NULL, NULL); if (rc < 0) { - rc = -EIO; goto exit_pingreq; } @@ -312,7 +307,6 @@ int mqtt_tx_subscribe(struct mqtt_ctx *ctx, u16_t pkt_id, u8_t items, rc = net_context_send(tx, NULL, ctx->net_timeout, NULL, NULL); if (rc < 0) { - rc = -EIO; net_pkt_unref(tx); } @@ -356,7 +350,6 @@ int mqtt_tx_unsubscribe(struct mqtt_ctx *ctx, u16_t pkt_id, u8_t items, rc = net_context_send(tx, NULL, ctx->net_timeout, NULL, NULL); if (rc < 0) { - rc = -EIO; net_pkt_unref(tx); } -- cgit v1.2.3