[parted-devel] [PATCH] parted: Print the Fixing... message to stderr

Brian C. Lane bcl at redhat.com
Thu Jul 11 00:02:06 BST 2024


Otherwise it messes up stdout of things like --json

Thanks to Mikael Q for reporting this.
---
 parted/ui.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/parted/ui.c b/parted/ui.c
index 33a1808..d6d1da4 100644
--- a/parted/ui.c
+++ b/parted/ui.c
@@ -645,7 +645,7 @@ exception_handler (PedException* ex)
         /* script-mode and fix? */
         int fix_is_an_option = (ex->options & PED_EXCEPTION_FIX);
         if (opt_script_mode && opt_fix_mode && fix_is_an_option) {
-                printf ("Fixing, due to --fix\n");
+                fprintf (stderr, "Fixing, due to --fix\n");
                 return PED_EXCEPTION_FIX;
         }
 
-- 
2.45.2




More information about the parted-devel mailing list