diff options
author | Richard Titmuss <richard_titmuss@eu.logitech.com> | 2009-02-18 10:51:39 +0200 |
---|---|---|
committer | Artem Bityutskiy <Artem.Bityutskiy@nokia.com> | 2009-02-18 10:52:57 +0200 |
commit | cca27d4c0819ae244b33639a19bec82cc2895704 (patch) | |
tree | 513085e3c1907845543e7a72ba160afbea88e4bd /ubi-utils/new-utils/src/libubi.c | |
parent | 822385dca7fd9816acf6227759ecea6b12f0fce4 (diff) |
UBI: add ubirename utility
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 | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/ubi-utils/new-utils/src/libubi.c b/ubi-utils/new-utils/src/libubi.c index 88215d0..1aa66d8 100644 --- a/ubi-utils/new-utils/src/libubi.c +++ b/ubi-utils/new-utils/src/libubi.c @@ -947,6 +947,27 @@ out_close: return ret; } +int ubi_rnvols(libubi_t desc, const char *node, struct ubi_rnvol_req *rnvol) +{ + int fd, ret; + + fd = open(node, O_RDONLY); + if (fd == -1) + return -1; + ret = ioctl(fd, UBI_IOCRNVOL, rnvol); + if (ret == -1) + goto out_close; + +#ifdef UDEV_SETTLE_HACK + if (system("udevsettle") == -1) + return -1; +#endif + +out_close: + close(fd); + return ret; +} + int ubi_rsvol(libubi_t desc, const char *node, int vol_id, long long bytes) { int fd, ret; |