mirror of https://github.com/mirror/busybox.git
nanddump: make dumping read-only partitions work
Make dumping read-only partitions work by opening the device O_RDONLY; otherwise the open() will fail with -EPERM. Signed-off-by: Matt Reimer <mreimer@sdgsystems.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>1_21_stable
parent
772f17a843
commit
6979325592
|
@ -129,7 +129,7 @@ int nandwrite_main(int argc UNUSED_PARAM, char **argv)
|
|||
xmove_fd(tmp_fd, IS_NANDDUMP ? STDOUT_FILENO : STDIN_FILENO);
|
||||
}
|
||||
|
||||
fd = xopen(argv[0], O_RDWR);
|
||||
fd = xopen(argv[0], IS_NANDWRITE ? O_RDWR : O_RDONLY);
|
||||
xioctl(fd, MEMGETINFO, &meminfo);
|
||||
|
||||
mtdoffset = xstrtou(opt_s, 0);
|
||||
|
|
Loading…
Reference in New Issue