Fix saving by sectors during --rescue

edge.strict_endians
szaka 2005-09-25 21:42:47 +00:00
parent a0338ab9b2
commit 431258997d
2 changed files with 5 additions and 1 deletions

View File

@ -60,6 +60,7 @@ xx/xx/2005 - 1.12.0-WIP
when calling ntfs_attr_get_search_ctx() except a very few cases which
genuinely need this functionality as they work on a too low level.
Make sure all those cases are ok.
- ntfsclone: fix saving by sectors during --rescue (Scott Hansen, Szaka)
08/08/2005 - 1.11.2 - ntfsdecrypt now works and lots of fixes and improvements.

View File

@ -496,18 +496,21 @@ static void rescue_sector(void *fd, off_t pos, void *buff)
}
static void copy_cluster(int rescue, off_t rescue_pos)
static void copy_cluster(int rescue, u64 rescue_lcn)
{
char buff[NTFS_MAX_CLUSTER_SIZE]; /* overflow checked at mount time */
/* vol is NULL if opt.restore_image is set */
u32 csize = image_hdr.cluster_size;
void *fd = (void *)&fd_in;
off_t rescue_pos;
if (!opt.restore_image) {
csize = vol->cluster_size;
fd = vol->dev;
}
rescue_pos = (off_t)(rescue_lcn * csize);
if (read_all(fd, buff, csize) == -1) {
if (errno != EIO)