[PATCH v2] nandwrite: implement -n (read/write without ecc)
Baruch Siach
baruch at tkos.co.il
Mon Nov 16 04:20:51 UTC 2015
Hi Aaro,
On Mon, Nov 16, 2015 at 02:10:53AM +0200, Aaro Koskinen wrote:
> Implement -n (read/write without ecc).
>
> Signed-off-by: Aaro Koskinen <aaro.koskinen at iki.fi>
[...]
> @@ -144,6 +147,9 @@ int nandwrite_main(int argc UNUSED_PARAM, char **argv)
> fd = xopen(argv[0], IS_NANDWRITE ? O_RDWR : O_RDONLY);
> xioctl(fd, MEMGETINFO, &meminfo);
>
> + if ((opts & OPT_n) && ioctl(fd, MTDFILEMODE, MTD_FILE_MODE_RAW))
> + bb_simple_perror_msg_and_die("MTDFILEMODE");
Why not just use xioctl instead of open coding it?
baruch
--
http://baruch.siach.name/blog/ ~. .~ Tk Open Systems
=}------------------------------------------------ooO--U--Ooo------------{=
- baruch at tkos.co.il - tel: +972.2.679.5364, http://www.tkos.co.il -
More information about the busybox
mailing list