mirror of
https://gitlab.com/cryptsetup/cryptsetup.git
synced 2025-12-05 16:00:05 +01:00
Reuse device file desriptors.
This commit is contained in:
committed by
Milan Broz
parent
ecbb9cfa90
commit
ee57b865b0
@@ -139,7 +139,7 @@ int crypt_wipe_device(struct crypt_device *cd,
|
||||
int (*progress)(uint64_t size, uint64_t offset, void *usrptr),
|
||||
void *usrptr)
|
||||
{
|
||||
int r, devfd = -1;
|
||||
int r, devfd;
|
||||
size_t bsize, alignment;
|
||||
char *sf = NULL;
|
||||
uint64_t dev_size;
|
||||
@@ -217,7 +217,6 @@ int crypt_wipe_device(struct crypt_device *cd,
|
||||
|
||||
device_sync(cd, device, devfd);
|
||||
out:
|
||||
close(devfd);
|
||||
free(sf);
|
||||
return r;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user