Report data sync errors from storage wrapper.

This commit is contained in:
Ondrej Kozina
2019-04-25 18:56:05 +02:00
parent b35a5ee4a3
commit 6c2760c9cd
2 changed files with 5 additions and 5 deletions

View File

@@ -383,14 +383,14 @@ void crypt_storage_wrapper_destroy(struct crypt_storage_wrapper *cw)
free(cw);
}
void crypt_storage_wrapper_datasync(const struct crypt_storage_wrapper *cw)
int crypt_storage_wrapper_datasync(const struct crypt_storage_wrapper *cw)
{
if (!cw)
return;
return -EINVAL;
if (cw->type == DMCRYPT)
fdatasync(cw->u.dm.dmcrypt_fd);
return fdatasync(cw->u.dm.dmcrypt_fd);
else
fdatasync(cw->dev_fd);
return fdatasync(cw->dev_fd);
}
crypt_storage_wrapper_type crypt_storage_wrapper_get_type(const struct crypt_storage_wrapper *cw)

View File

@@ -65,7 +65,7 @@ ssize_t crypt_storage_wrapper_encrypt_write(struct crypt_storage_wrapper *cw,
ssize_t crypt_storage_wrapper_encrypt(struct crypt_storage_wrapper *cw,
off_t offset, void *buffer, size_t buffer_length);
void crypt_storage_wrapper_datasync(const struct crypt_storage_wrapper *cw);
int crypt_storage_wrapper_datasync(const struct crypt_storage_wrapper *cw);
crypt_storage_wrapper_type crypt_storage_wrapper_get_type(const struct crypt_storage_wrapper *cw);
#endif