This will allow separating first block buffer from a buffer used for MD5
calculation.
Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
git-svn-id: svn://svn.openwrt.org/openwrt/trunk@49307
3c298f89-4303-0410-b956-
a3cf2f4a3e73
ssize_t pwrite(int fd, const void *buf, size_t count, off_t offset);
int
ssize_t pwrite(int fd, const void *buf, size_t count, off_t offset);
int
-seama_fix_md5(char *buf, size_t len)
+seama_fix_md5(struct seama_entity_header *shdr, char *buf, size_t len)
- struct seama_entity_header *shdr = (struct seama_entity_header *) buf;
char *data;
size_t msize;
size_t isize;
char *data;
size_t msize;
size_t isize;
- if (seama_fix_md5(buf, mtdsize))
+ if (seama_fix_md5(shdr, buf, mtdsize))
goto out;
if (mtd_erase_block(fd, block_offset)) {
goto out;
if (mtd_erase_block(fd, block_offset)) {
if (quiet < 2)
fprintf(stderr, "Rewriting block at 0x%x\n", block_offset);
if (quiet < 2)
fprintf(stderr, "Rewriting block at 0x%x\n", block_offset);
- if (pwrite(fd, buf, erasesize, block_offset) != erasesize) {
+ if (pwrite(fd, first_block, erasesize, block_offset) != erasesize) {
fprintf(stderr, "Error writing block (%s)\n", strerror(errno));
exit(1);
}
fprintf(stderr, "Error writing block (%s)\n", strerror(errno));
exit(1);
}