From 292475cbc4e92f1651a751e6d2b178a37d56d073 Mon Sep 17 00:00:00 2001 From: Jeremy Kerr Date: Thu, 22 Oct 2015 08:24:36 +0800 Subject: gard: print error message when we can't open a flash device 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 Signed-off-by: Stewart Smith --- 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) -- cgit v1.1