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; }