projects
/
systemd
/
.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
7aa610f
)
cryptsetup: do not 'fail' if trying to detach a nonexistent device
author
Mantas Mikulėnas
<grawity@gmail.com>
Fri, 1 Apr 2016 18:51:20 +0000
(21:51 +0300)
committer
Lennart Poettering
<lennart@poettering.net>
Fri, 1 Apr 2016 18:51:20 +0000
(20:51 +0200)
It could be that our .service is being stopped precisely because the
device already disappeared (e.g. due to a manual `cryptsetup close`, or
due to UDisks2 cleaning up).
src/cryptsetup/cryptsetup.c
patch
|
blob
|
history
diff --git
a/src/cryptsetup/cryptsetup.c
b/src/cryptsetup/cryptsetup.c
index 2ef966257a9d3e2615c06082d306688f765c3879..9927621ea0579452ba657fd337a0f0047833f8db 100644
(file)
--- a/
src/cryptsetup/cryptsetup.c
+++ b/
src/cryptsetup/cryptsetup.c
@@
-719,8
+719,12
@@
int main(int argc, char *argv[]) {
int k;
k = crypt_init_by_name(&cd, argv[2]);
- if (k) {
- log_error_errno(k, "crypt_init() failed: %m");
+ if (k == -ENODEV) {
+ log_info("Volume %s already inactive.", argv[2]);
+ r = EXIT_SUCCESS;
+ goto finish;
+ } else if (k) {
+ log_error_errno(k, "crypt_init_by_name() failed: %m");
goto finish;
}