mirror of
https://gitlab.com/cryptsetup/cryptsetup.git
synced 2025-12-09 09:49:59 +01:00
Reuse device file desriptors.
This commit is contained in:
committed by
Milan Broz
parent
ecbb9cfa90
commit
ee57b865b0
@@ -35,9 +35,8 @@ static int INTEGRITY_read_superblock(struct crypt_device *cd,
|
||||
int devfd, r;
|
||||
|
||||
devfd = device_open(cd, device, O_RDONLY);
|
||||
if(devfd < 0) {
|
||||
if(devfd < 0)
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
if (read_lseek_blockwise(devfd, device_block_size(cd, device),
|
||||
device_alignment(device), sb, sizeof(*sb), offset) != sizeof(*sb) ||
|
||||
@@ -55,7 +54,6 @@ static int INTEGRITY_read_superblock(struct crypt_device *cd,
|
||||
r = 0;
|
||||
}
|
||||
|
||||
close(devfd);
|
||||
return r;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user