[PATCH 1/8] memtest.c: Print iterations count if -i is 0

Andrey Smirnov andrew.smirnov at gmail.com
Sun Oct 11 11:43:34 PDT 2015


Even if memtest is started in endless mode it is still usefult to see
current iteration count. Add the code to print that.

Signed-off-by: Andrey Smirnov <andrew.smirnov at gmail.com>
---
 commands/memtest.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/commands/memtest.c b/commands/memtest.c
index 7561230..b88290c 100644
--- a/commands/memtest.c
+++ b/commands/memtest.c
@@ -180,8 +180,12 @@ static int do_memtest(int argc, char *argv[])
 		goto out;

 	for (i = 1; (i <= max_i) || !max_i; i++) {
+		printf("Start iteration %u", i);
 		if (max_i)
-			printf("Start iteration %u of %u.\n", i, max_i);
+			printf(" of %u.\n", max_i);
+		else
+			putchar('\n');
+
 		/*
 		 * First try a memtest with caching enabled.
 		 */
--
2.1.4



More information about the barebox mailing list