]> www.infradead.org Git - mtd-utils.git/commit
nandwrite: unified reading from standard input and from file - part 3
authorJehan Bing <jehan@orb.com>
Thu, 6 Aug 2009 00:40:55 +0000 (17:40 -0700)
committerArtem Bityutskiy <Artem.Bityutskiy@nokia.com>
Tue, 11 Aug 2009 13:14:20 +0000 (16:14 +0300)
commit07005d915d6a79dbdee14b0c4360df5058c3a98b
tree86726e622c18c76e39bad4bf2a7dcd4c7bfbab3f
parent8c7e9e0936fcb18f1c95e618c2a2bb138a3c9e35
nandwrite: unified reading from standard input and from file - part 3

Nandwrite tries to use lseek() when failing to write on a page. lseek()
will fail when used on the standard input so nandwrite fails. This code
replaces lseek with a buffer.

When the data is read, it is put in a buffer (filebuf). This buffer is
reset at each block boundary. So a "seek" just means reading from the
beginning of the buffer. writebuf and oobreadbuf are now just pointers
to locations in filebuf.

Signed-off-by: Jehan Bing <jehan@orb.com>
Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
nandwrite.c