[coreboot-gerrit] New patch to review for coreboot: util/cbfstool: Print normal output to stdout, not stderr

Martin Roth (martinroth@google.com) gerrit at coreboot.org
Thu Jan 19 17:22:46 CET 2017


Martin Roth (martinroth at google.com) just uploaded a new patch set to gerrit, which you can find at https://review.coreboot.org/18175

-gerrit

commit 252fb341cddfdfde0401f8e4b8cfc16f6a2f4cc9
Author: Martin Roth <martinroth at google.com>
Date:   Thu Jan 19 09:21:56 2017 -0700

    util/cbfstool: Print normal output to stdout, not stderr
    
    stderr should be used for warnings and error messages.
    
    Change-Id: I2356d6882bf38525bf737cbb04edf11c00488ebf
    Signed-off-by: Martin Roth <martinroth at google.com>
---
 util/cbfstool/cbfs_image.c      | 6 +++---
 util/cbfstool/console/console.h | 6 +++---
 util/cbfstool/fmaptool.c        | 4 ++--
 3 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/util/cbfstool/cbfs_image.c b/util/cbfstool/cbfs_image.c
index e530224..f866d6d 100644
--- a/util/cbfstool/cbfs_image.c
+++ b/util/cbfstool/cbfs_image.c
@@ -601,7 +601,7 @@ static int cbfs_add_entry_at(struct cbfs_image *image,
 		DEBUG("|min|...|header|content|... <create new entry>\n");
 		len = header_offset - addr - min_entry_size;
 		cbfs_create_empty_entry(entry, CBFS_COMPONENT_NULL, len, "");
-		if (verbose > 1) cbfs_print_entry_info(image, entry, stderr);
+		if (verbose > 1) cbfs_print_entry_info(image, entry, stdout);
 		entry = cbfs_find_next_entry(image, entry);
 		addr = cbfs_get_entry_addr(image, entry);
 	}
@@ -627,7 +627,7 @@ static int cbfs_add_entry_at(struct cbfs_image *image,
 	assert((char*)CBFS_SUBHEADER(entry) - image->buffer.data ==
 	       (ptrdiff_t)content_offset);
 	memcpy(CBFS_SUBHEADER(entry), data, ntohl(entry->len));
-	if (verbose > 1) cbfs_print_entry_info(image, entry, stderr);
+	if (verbose > 1) cbfs_print_entry_info(image, entry, stdout);
 
 	// Process buffer AFTER entry.
 	entry = cbfs_find_next_entry(image, entry);
@@ -652,7 +652,7 @@ static int cbfs_add_entry_at(struct cbfs_image *image,
 		len -= sizeof(int32_t);
 	}
 	cbfs_create_empty_entry(entry, CBFS_COMPONENT_NULL, len, "");
-	if (verbose > 1) cbfs_print_entry_info(image, entry, stderr);
+	if (verbose > 1) cbfs_print_entry_info(image, entry, stdout);
 	return 0;
 }
 
diff --git a/util/cbfstool/console/console.h b/util/cbfstool/console/console.h
index 40c1436..51296b9 100644
--- a/util/cbfstool/console/console.h
+++ b/util/cbfstool/console/console.h
@@ -23,9 +23,9 @@
 extern int verbose;
 #define ERROR(...) { fprintf(stderr, "E: " __VA_ARGS__); }
 #define WARN(...) { fprintf(stderr, "W: " __VA_ARGS__); }
-#define LOG(...) { fprintf(stderr, __VA_ARGS__); }
-#define INFO(...) { if (verbose > 0) fprintf(stderr, "INFO: " __VA_ARGS__); }
-#define DEBUG(...) { if (verbose > 1) fprintf(stderr, "DEBUG: " __VA_ARGS__); }
+#define LOG(...) { fprintf(stdout, __VA_ARGS__); }
+#define INFO(...) { if (verbose > 0) fprintf(stdout, "INFO: " __VA_ARGS__); }
+#define DEBUG(...) { if (verbose > 1) fprintf(stdout, "DEBUG: " __VA_ARGS__); }
 
 
 #define printk(lvl, ...) \
diff --git a/util/cbfstool/fmaptool.c b/util/cbfstool/fmaptool.c
index faf6508..d1311f1 100644
--- a/util/cbfstool/fmaptool.c
+++ b/util/cbfstool/fmaptool.c
@@ -250,10 +250,10 @@ int main(int argc, char **argv)
 		return FMAPTOOL_EXIT_FAILED_WRITING_HEADER;
 	}
 
-	fprintf(stderr, "SUCCESS: Wrote %d bytes to file '%s'%s\n", size,
+	fprintf(stdout, "SUCCESS: Wrote %d bytes to file '%s'%s\n", size,
 							args.fmap_filename,
 			args.header_filename ? " (and generated header)" : "");
-	fputs("The sections containing CBFSes are: ", stderr);
+	fputs("The sections containing CBFSes are: ", stdout);
 	list_cbfs_section_names(stdout);
 	if (args.region_filename) {
 		FILE *region_file = fopen(args.region_filename, "w");



More information about the coreboot-gerrit mailing list