From e6c387a96f6c3cae91e5bf1a6f7e6574cbe03b80 Mon Sep 17 00:00:00 2001 From: Artem Bityutskiy Date: Thu, 17 Apr 2008 15:53:35 +0300 Subject: Teach libubi_open not to prirnt error message ... when it is expected that UBI is not necessarily present Signed-off-by: Artem Bityutskiy --- ubi-utils/new-utils/src/libubi.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'ubi-utils/new-utils/src/libubi.c') diff --git a/ubi-utils/new-utils/src/libubi.c b/ubi-utils/new-utils/src/libubi.c index b53f18c..f0cbc9e 100644 --- a/ubi-utils/new-utils/src/libubi.c +++ b/ubi-utils/new-utils/src/libubi.c @@ -15,7 +15,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * - * Author: Artem B. Bityutskiy + * Author: Artem Bityutskiy * * UBI (Unsorted Block Images) library. */ @@ -501,7 +501,7 @@ static int mtd_num2ubi_dev(struct libubi *lib, int mtd_num, int *dev_num) return -1; } -libubi_t libubi_open(void) +libubi_t libubi_open(int required) { int fd, version; struct libubi *lib; @@ -530,8 +530,9 @@ libubi_t libubi_open(void) /* Make sure UBI is present */ fd = open(lib->sysfs_ubi, O_RDONLY); if (fd == -1) { - errmsg("cannot open \"%s\", UBI does not seem to exist in system", - lib->sysfs_ubi); + if (required) + errmsg("cannot open \"%s\", UBI does not seem to " + "exist in system", lib->sysfs_ubi); goto out_error; } -- cgit v1.2.3