} else
//usage:#define ubiupdatevol_trivial_usage
-//usage: "[-t | [-s SIZE] IMG_FILE] UBI_DEVICE"
+//usage: "-t UBI_DEVICE | [-s SIZE] UBI_DEVICE IMG_FILE"
//usage:#define ubiupdatevol_full_usage "\n\n"
//usage: "Update UBI volume\n"
//usage: "\n -t Truncate to zero size"
xioctl(fd, UBI_IOCVOLUP, &bytes64);
}
else {
- struct stat st;
unsigned ubinum, volnum;
unsigned leb_size;
ssize_t len;
sprintf(path_sys_class_ubi_ubi, "%u_%u/usable_eb_size", ubinum, volnum);
leb_size = get_num_from_file(path, MAX_SANE_ERASEBLOCK, "Can't get usable eraseblock size from '%s'");
- if (!(opts & OPTION_s)) {
+ if (!(opts & OPTION_t)) {
if (!*argv)
bb_show_usage();
xmove_fd(xopen(*argv, O_RDONLY), STDIN_FILENO);
- xfstat(STDIN_FILENO, &st, *argv);
- size_bytes = st.st_size;
+ if (!(opts & OPTION_s)) {
+ struct stat st;
+ xfstat(STDIN_FILENO, &st, *argv);
+ size_bytes = st.st_size;
+ }
}
bytes64 = size_bytes;