mirror of
https://gitlab.com/cryptsetup/cryptsetup.git
synced 2025-12-14 12:20:00 +01:00
extend use of lseek_blockwise functions
This commit is contained in:
committed by
Milan Broz
parent
ed19ddf620
commit
82d81b9e86
@@ -183,9 +183,9 @@ int LUKS_encrypt_to_storage(char *src, size_t srcLength,
|
||||
if (devfd < 0)
|
||||
goto out;
|
||||
|
||||
if (lseek(devfd, sector * SECTOR_SIZE, SEEK_SET) == -1 ||
|
||||
write_blockwise(devfd, device_block_size(device),
|
||||
device_alignment(device), src, srcLength) == -1)
|
||||
if (write_lseek_blockwise(devfd, device_block_size(device),
|
||||
device_alignment(device), src, srcLength,
|
||||
sector * SECTOR_SIZE) < 0)
|
||||
goto out;
|
||||
|
||||
r = 0;
|
||||
@@ -239,9 +239,9 @@ int LUKS_decrypt_from_storage(char *dst, size_t dstLength,
|
||||
if (devfd < 0)
|
||||
goto bad;
|
||||
|
||||
if (lseek(devfd, sector * SECTOR_SIZE, SEEK_SET) == -1 ||
|
||||
read_blockwise(devfd, device_block_size(device),
|
||||
device_alignment(device), dst, dstLength) == -1)
|
||||
if (read_lseek_blockwise(devfd, device_block_size(device),
|
||||
device_alignment(device), dst, dstLength,
|
||||
sector * SECTOR_SIZE) < 0)
|
||||
goto bad;
|
||||
|
||||
close(devfd);
|
||||
|
||||
Reference in New Issue
Block a user