From 24f0f8278a794db3b149645e44a2cdeaff238df8 Mon Sep 17 00:00:00 2001 From: Vitaliy Filippov Date: Mon, 29 Nov 2021 01:52:21 +0300 Subject: [PATCH] Fix modify --readwrite --- src/cli_modify.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/cli_modify.cpp b/src/cli_modify.cpp index 56524769..59d58da8 100644 --- a/src/cli_modify.cpp +++ b/src/cli_modify.cpp @@ -70,7 +70,7 @@ struct image_changer_t // Check confirmation when trimming an image with children if (has_children && !force) { - fprintf(stderr, "Image %s has children. Refusing to shrink it without --force", image_name.c_str()); + fprintf(stderr, "Image %s has children. Refusing to shrink it without --force\n", image_name.c_str()); exit(1); } // Shrink the image first @@ -98,9 +98,9 @@ resume_1: { cfg.readonly = false; // Check confirmation when making an image with children read-write - if (!force) + if (has_children && !force) { - fprintf(stderr, "Image %s has children. Refusing to make it read-write without --force", image_name.c_str()); + fprintf(stderr, "Image %s has children. Refusing to make it read-write without --force\n", image_name.c_str()); exit(1); } } @@ -184,7 +184,7 @@ resume_1: resume_2: if (parent->waiting > 0) return; - printf("Image %s changed\n", image_name.c_str()); + printf("Image %s modified\n", image_name.c_str()); state = 100; } };