[Skiboot] [PATCH] gard: print error message when we can't open a flash device

Jeremy Kerr jk at ozlabs.org
Thu Oct 22 11:24:36 AEDT 2015


If I run gard on system flash as a non-root user, I get:

  $ ./external/gard/gard list
  $ echo $?
  1

which isn't too helpful. This change adds a basic error message to the
open() failure.

Signed-off-by: Jeremy Kerr <jk at ozlabs.org>
---
 external/gard/gard.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/external/gard/gard.c b/external/gard/gard.c
index 01488e3..4e891f3 100644
--- a/external/gard/gard.c
+++ b/external/gard/gard.c
@@ -741,7 +741,7 @@ int main(int argc, char **argv)
 
 	rc = file_init_path(filename, NULL, &(ctx->bl));
 	if (rc)
-		return EXIT_FAILURE;
+		err(EXIT_FAILURE, "Can't open %s", filename);
 
 	rc = blocklevel_get_info(ctx->bl, NULL, &(ctx->f_size), NULL);
 	if (rc)
-- 
2.1.4



More information about the Skiboot mailing list