Add test for deferred removal.

Print more info in CLI command.
This commit is contained in:
Milan Broz
2017-06-24 10:32:48 +02:00
parent 3efa00d59a
commit 164bbdfcfc
2 changed files with 18 additions and 0 deletions

View File

@@ -422,6 +422,7 @@ out:
static int action_close(void)
{
struct crypt_device *cd = NULL;
crypt_status_info ci;
uint32_t flags = 0;
int r;
@@ -432,6 +433,13 @@ static int action_close(void)
if (r == 0)
r = crypt_deactivate_by_name(cd, action_argv[0], flags);
if (!r && opt_deferred_remove) {
ci = crypt_status(cd, action_argv[0]);
if (ci == CRYPT_ACTIVE || ci == CRYPT_BUSY)
log_std(_("Device %s is still active and scheduled for deferred removal.\n"),
action_argv[0]);
}
crypt_free(cd);
return r;
}