mirror of
https://gitlab.com/cryptsetup/cryptsetup.git
synced 2025-12-14 20:30:04 +01:00
Add test for deferred removal.
Print more info in CLI command.
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user