Skip to content

Commit 88d64b2

Browse files
committed
[CHKDSK][VFATLIB] Chkdsk improve code
CORE-20546 Avoid second lseek if we do not have "use_read" and need to do read alignment.
1 parent a409e5d commit 88d64b2

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

  • sdk/lib/fslib/vfatlib/check

sdk/lib/fslib/vfatlib/check/io.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -372,10 +372,10 @@ void fs_write(off_t pos, int size, void *data)
372372

373373
/* Patch data in memory */
374374
memcpy((char *)scratch + seek_delta, data, size);
375-
}
376375

377-
/* Seek back to the beginning of our read/write */
378-
if (lseek(fd, seekpos_aligned, 0) != seekpos_aligned) pdie("Seek to %lld",seekpos_aligned);
376+
/* Seek back to the beginning of our read */
377+
if (lseek(fd, seekpos_aligned, 0) != seekpos_aligned) pdie("Seek to %lld",seekpos_aligned);
378+
}
379379

380380
/* Write it back */
381381
if ((did = write(fd, scratch, readsize_aligned)) == (int)readsize_aligned)

0 commit comments

Comments
 (0)