I'll hold off on a bit to see if Brian sees my e-mail and has any ideas
3 comments:
Patch Set #4, Line 231: perr(
Maybe there actually is an alignment requirement? In that case […]
strace showed the fread() working, but I didn't see it try to do the fwrite() after the fseek(). I'm not sure what that means, maybe fwrite() just doesn't work on certain types of files? I also tried adjusting chunksize, and reversing the size and nmemb args, but didn't have any luck there. So I sent an e-mail to one of the MTD maintainers (briannorris) in case he has any ideas.
(BTW - the error string I mentioned earlier might not be relevant since fwrite() doesn't set errno)
Since the MTD write-protect functions use a few ioctl()s, I think it would make more sense to convert from file descriptor --> stream in the cases where fread() can be used. Does that sound good?
Patch Set #5, Line 208: if (fread(buf + i, step, 1, dev_fp) != 1) {
`step, 1`, i.e. reading one big chunk, might be better optimized in libc.
Done
Nit, we know both `buf` and "nor" are zero-terminated. There is no […]
Done
To view, visit change 25706. To unsubscribe, or for help writing mail filters, visit settings.