]> www.infradead.org Git - mtd-utils.git/commit
MTD-Utils: fix handling of ioctl return value in nand-utils
authorFrank Haverkamp <haver@vnet.ibm.com>
Wed, 14 Mar 2007 13:17:07 +0000 (14:17 +0100)
committerJosh Boyer <jwboyer@gmail.com>
Thu, 15 Mar 2007 13:07:47 +0000 (08:07 -0500)
commit876476b7bbf158c64868d379460a7b6bce7e95e0
treea380ad1eabfd0cc810743139707395dbf672f4e6
parent12d798a29a9a376ef495f527b1785317e3ae3d37
MTD-Utils: fix handling of ioctl return value in nand-utils

Older kernel do not implement the MTDFILEMODE ioctl. In this case
nandwrite and nanddump should have used MEMGETOOBSEL in combination
with MEMSETOOBSEL. Unfortunately the return value of the unsucessfull
ioctl is not -ENOTTY, but -1 and errno contains ENOTTY. This change
fixes this issue. I have not tested all cornercases. Would be
good if someone could do more careful testing than I did, or maybe
reviewing is sufficient in this case.

Signed-off-by: Frank Haverkamp <haver@vnet.ibm.com>
Signed-off-by: Josh Boyer <jwboyer@gmail.com>
nanddump.c
nandwrite.c