add oleg's jffs2root fix

SVN-Revision: 800
owl
Felix Fietkau 2005-05-04 14:37:13 +00:00
parent 6bca05dcc2
commit 39b4d40f77
1 changed files with 3 additions and 2 deletions

View File

@ -98,7 +98,7 @@ int main(int argc, char **argv)
//bzero((void *)((int)ptr + ptr->len), (size_t)(len - ptr->len)); //bzero((void *)((int)ptr + ptr->len), (size_t)(len - ptr->len));
ptr->len = offset; ptr->len = offset;
ptr->crc32 = crc32buf((void *) &(ptr->flag_version), ptr->len - offsetof(struct trx_header, flag_version)); ptr->crc32 = crc32buf((void *) &(ptr->flag_version), ptr->len - offsetof(struct trx_header, flag_version));
msync(ptr,len,MS_SYNC|MS_INVALIDATE); msync(ptr,sizeof(struct trx_header),MS_SYNC|MS_INVALIDATE);
printf("Partition moved; please reboot\n"); printf("Partition moved; please reboot\n");
} }
} else { } else {
@ -113,6 +113,7 @@ int main(int argc, char **argv)
} }
munmap((void *) ptr, sizeof(struct trx_header)); munmap((void *) ptr, len);
close (fd);
return 0; return 0;
} }