mirror of
https://github.com/reactos/reactos.git
synced 2026-06-03 01:41:13 +08:00
[CHKDSK][VFATLIB] Chkdsk, fix writes to wrong disk offsets (#8840)
CORE-20546 When an alignment is needed and a new read is required, make sure we seek back to the read position for our write.
This commit is contained in:
@@ -374,6 +374,9 @@ void fs_write(off_t pos, int size, void *data)
|
||||
memcpy((char *)scratch + seek_delta, data, size);
|
||||
}
|
||||
|
||||
/* Seek back to the beginning of our read/write */
|
||||
if (lseek(fd, seekpos_aligned, 0) != seekpos_aligned) pdie("Seek to %lld",seekpos_aligned);
|
||||
|
||||
/* Write it back */
|
||||
if ((did = write(fd, scratch, readsize_aligned)) == (int)readsize_aligned)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user