mirror of
https://gitlab.com/cryptsetup/cryptsetup.git
synced 2025-12-05 16:00:05 +01:00
Sync device using internal write enabled descriptor.
This commit is contained in:
committed by
Milan Broz
parent
ee57b865b0
commit
83c227d53c
@@ -240,11 +240,13 @@ static int _open_locked(struct crypt_device *cd, struct device *device, int flag
|
||||
|
||||
/*
|
||||
* Common wrapper for device sync.
|
||||
* FIXME: file descriptor will be in struct later.
|
||||
*/
|
||||
void device_sync(struct crypt_device *cd, struct device *device, int devfd)
|
||||
void device_sync(struct crypt_device *cd, struct device *device)
|
||||
{
|
||||
if (fsync(devfd) == -1)
|
||||
if (!device || device->dev_fd < 0)
|
||||
return;
|
||||
|
||||
if (fsync(device->dev_fd) == -1)
|
||||
log_dbg(cd, "Cannot sync device %s.", device_path(device));
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user