diff options
author | Artem Bityutskiy <Artem.Bityutskiy@nokia.com> | 2008-04-17 15:53:35 +0300 |
---|---|---|
committer | Artem Bityutskiy <Artem.Bityutskiy@nokia.com> | 2008-04-17 15:53:35 +0300 |
commit | e6c387a96f6c3cae91e5bf1a6f7e6574cbe03b80 (patch) | |
tree | ef8c4f2e88c740ef1d597d54f33199c5ae2550e1 /ubi-utils/new-utils/src/libubi.c | |
parent | bcc87aa2d908389534394caa8659fd613817584f (diff) |
Teach libubi_open not to prirnt error message
... when it is expected that UBI is not necessarily present
Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
Diffstat (limited to 'ubi-utils/new-utils/src/libubi.c')
-rw-r--r-- | ubi-utils/new-utils/src/libubi.c | 9 |
1 files changed, 5 insertions, 4 deletions
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; } |