From 77afc86412aedeb8c05a90e293db3541cb6cc213 Mon Sep 17 00:00:00 2001 From: "Roger A. Light" Date: Tue, 21 May 2019 11:39:19 +0100 Subject: [PATCH] Fix mosquitto_pub exiting with error code 0 when an error occurred. Thanks to janniswarnat. Closes #1285. --- ChangeLog.txt | 2 ++ client/pub_client.c | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/ChangeLog.txt b/ChangeLog.txt index eeaa2332..62a0a788 100644 --- a/ChangeLog.txt +++ b/ChangeLog.txt @@ -15,6 +15,8 @@ Clients: - Fix -L url parsing when `/topic` part is missing. - Stop some error messages being printed even when `--quiet` was used. Closes #1284. +- Fix mosquitto_pub exiting with error code 0 when an error occurred. + Closes #1285. 1.6.2 - 20190430 diff --git a/client/pub_client.c b/client/pub_client.c index 60d652a3..96fc8f12 100644 --- a/client/pub_client.c +++ b/client/pub_client.c @@ -312,7 +312,7 @@ int pub_shared_loop(struct mosquitto *mosq) if(mode == MSGMODE_STDIN_LINE){ mosquitto_loop_stop(mosq, false); } - return 0; + return rc; }