From: Radosław Korzeniewski Date: Fri, 8 Jan 2021 14:20:23 +0000 (+0100) Subject: metaplugin: Correct error message format. X-Git-Tag: Release-11.3.2~724 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=1220c09a338be897631ca40659bfd01496a86ead;p=thirdparty%2Fbacula.git metaplugin: Correct error message format. --- diff --git a/bacula/src/plugins/fd/pluginlib/metaplugin.cpp b/bacula/src/plugins/fd/pluginlib/metaplugin.cpp index f6faf29cc..fedb08768 100644 --- a/bacula/src/plugins/fd/pluginlib/metaplugin.cpp +++ b/bacula/src/plugins/fd/pluginlib/metaplugin.cpp @@ -869,14 +869,17 @@ bRC METAPLUGIN::send_startjob(bpContext *ctx, const char *command) POOL_MEM cmd; pm_strcpy(cmd, command); - if (backend.ctx->write_command(ctx, cmd) < 0){ + if (backend.ctx->write_command(ctx, cmd) < 0) + { /* error */ return bRC_Error; } - if (!backend.ctx->read_ack(ctx)){ - DMSG(ctx, DERROR, "Wrong backend response to %s command.\n", command); - JMSG(ctx, backend.ctx->jmsg_err_level(), "Wrong backend response to %s command.\n", command); + if (!backend.ctx->read_ack(ctx)) + { + strip_trailing_newline(cmd.c_str()); + DMSG(ctx, DERROR, "Wrong backend response to %s command.\n", cmd.c_str()); + JMSG(ctx, backend.ctx->jmsg_err_level(), "Wrong backend response to %s command.\n", cmd.c_str()); return bRC_Error; }