From 00d99ae46cfef3a399e82d161f8bf705ec0c10d0 Mon Sep 17 00:00:00 2001 From: Artem Bityutskiy Date: Wed, 22 Apr 2009 17:24:07 +0300 Subject: libubi: improve errors handling Improve comments about what is returned if UBI device or node does not exist. Better check for ENODEV error code. Signed-off-by: Artem Bityutskiy --- ubi-utils/src/ubinfo.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'ubi-utils/src/ubinfo.c') diff --git a/ubi-utils/src/ubinfo.c b/ubi-utils/src/ubinfo.c index 025ac62..036ed6c 100644 --- a/ubi-utils/src/ubinfo.c +++ b/ubi-utils/src/ubinfo.c @@ -142,8 +142,8 @@ static int translate_dev(libubi_t libubi, const char *node) err = ubi_probe_node(libubi, node); if (err == -1) { - if (errno) - return errmsg("unrecognized device node \"%s\"", node); + if (errno != ENODEV) + return sys_errmsg("error while probing \"%s\"", node); return errmsg("\"%s\" does not correspond to any UBI device or volume", node); } -- cgit v1.2.3