summaryrefslogtreecommitdiff
path: root/ubi-utils/src/ubirename.c
diff options
context:
space:
mode:
Diffstat (limited to 'ubi-utils/src/ubirename.c')
-rw-r--r--ubi-utils/src/ubirename.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/ubi-utils/src/ubirename.c b/ubi-utils/src/ubirename.c
index 14331b6..08b3cd5 100644
--- a/ubi-utils/src/ubirename.c
+++ b/ubi-utils/src/ubirename.c
@@ -92,9 +92,12 @@ int main(int argc, char * const argv[])
}
node = argv[1];
- 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, node);
if (err == 2) {