Reuse device file desriptors.

This commit is contained in:
Ondrej Kozina
2019-05-10 15:19:33 +02:00
committed by Milan Broz
parent ecbb9cfa90
commit ee57b865b0
14 changed files with 105 additions and 118 deletions

View File

@@ -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;
}