[PATCH 2/2] commands: barebox-update: Improve nonexistent handler reporting

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Convert code printing said error message to be more informative and
avoid printing <NULL> for handler name.

Signed-off-by: Andrey Smirnov <andrew.smirnov@xxxxxxxxx>
---
 commands/barebox-update.c | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/commands/barebox-update.c b/commands/barebox-update.c
index f76aa19a5..89aa9fddb 100644
--- a/commands/barebox-update.c
+++ b/commands/barebox-update.c
@@ -63,7 +63,15 @@ static int do_barebox_update(int argc, char *argv[])
 	}
 
 	if (!barebox_update_handler_exists(&data)) {
-		printf("handler '%s' does not exist\n", data.handler_name);
+		if (data.handler_name)
+			printf("handler '%s' does not exist\n",
+			       data.handler_name);
+		else if (data.devicefile)
+			printf("handler for '%s' does not exist\n",
+			       data.devicefile);
+		else
+			printf("default handler does not exist\n");
+
 		print_handlers_list();
 		return COMMAND_ERROR;
 	}
-- 
2.17.1


_______________________________________________
barebox mailing list
barebox@xxxxxxxxxxxxxxxxxxx
http://lists.infradead.org/mailman/listinfo/barebox



[Index of Archives]     [Linux Embedded]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux