From 1220c09a338be897631ca40659bfd01496a86ead Mon Sep 17 00:00:00 2001 From: =?utf8?q?Rados=C5=82aw=20Korzeniewski?= Date: Fri, 8 Jan 2021 15:20:23 +0100 Subject: [PATCH] metaplugin: Correct error message format. --- bacula/src/plugins/fd/pluginlib/metaplugin.cpp | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) 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; } -- 2.47.3