From e4d974bb63355d1fff92eaae4df5f0cdf3597dc3 Mon Sep 17 00:00:00 2001 From: Artem Bityutskiy Date: Wed, 22 Apr 2009 14:32:08 +0300 Subject: libubi: improve libubi_open interface Remove the not very nice @required parameter, and add a possibility to distinguish between real errors and a situation when UBI is not present. Signed-off-by: Artem Bityutskiy --- ubi-utils/src/ubimkvol.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'ubi-utils/src/ubimkvol.c') diff --git a/ubi-utils/src/ubimkvol.c b/ubi-utils/src/ubimkvol.c index 8d6029a..dba7133 100644 --- a/ubi-utils/src/ubimkvol.c +++ b/ubi-utils/src/ubimkvol.c @@ -238,9 +238,12 @@ int main(int argc, char * const argv[]) if (err) return err; - libubi = libubi_open(1); - if (!libubi) + libubi = libubi_open(); + if (!libubi) { + if (errno == 0) + return errmsg("UBI is not present in the system"); return sys_errmsg("cannot open libubi"); + } err = ubi_probe_node(libubi, args.node); if (err == 2) { -- cgit v1.2.3