diff options
Diffstat (limited to 'nandwrite.c')
-rw-r--r-- | nandwrite.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/nandwrite.c b/nandwrite.c index d3486b9..7bb57cd 100644 --- a/nandwrite.c +++ b/nandwrite.c @@ -626,8 +626,8 @@ int main(int argc, char * const argv[]) if (pwrite(fd, writebuf, meminfo.writesize, mtdoffset) != meminfo.writesize) { erase_info_t erase; - perror ("pwrite"); if (errno != EIO) { + perror("pwrite"); goto closeall; } @@ -639,8 +639,9 @@ int main(int argc, char * const argv[]) fprintf(stderr, "Erasing failed write from %08lx-%08lx\n", (long)erase.start, (long)erase.start+erase.length-1); if (ioctl(fd, MEMERASE, &erase) != 0) { + int errno_tmp = errno; perror("MEMERASE"); - if (errno != EIO) { + if (errno_tmp != EIO) { goto closeall; } } |