From 044fed7657a0e73acb5ab4539fee2ccc34353e2e Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?David=20Va=C5=A1ek?= <david.vasek@nic.cz>
Date: Fri, 12 Feb 2021 13:07:32 +0100
Subject: [PATCH] ctl/backup: when the zone is busy, report the error in a
 standard way (and to knotc too)

Also, make the warning message more correct.
---
 src/knot/ctl/commands.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/src/knot/ctl/commands.c b/src/knot/ctl/commands.c
index f03fd4bd67..f42da334bd 100644
--- a/src/knot/ctl/commands.c
+++ b/src/knot/ctl/commands.c
@@ -520,8 +520,9 @@ static int zone_backup_cmd(zone_t *zone, ctl_args_t *args)
 	}
 
 	if (zone->backup_ctx != NULL) {
-		log_zone_warning(zone->name, "backup already in progress, skipping zone");
-		return KNOT_EOK;
+		log_zone_warning(zone->name, "backup or restore already in progress, skipping zone");
+		ctx->failed = true;
+		return KNOT_EPROGRESS;
 	}
 
 	zone->backup_ctx = ctx;
-- 
GitLab