mirror of
https://gitlab.com/cryptsetup/cryptsetup.git
synced 2025-12-05 16:00:05 +01:00
Check device mapper communication and warn user in case the communication fails. Thanks to Milan Broz.
git-svn-id: https://cryptsetup.googlecode.com/svn/trunk@31 36d66b0a-2a48-0410-832c-cd162a569da5
This commit is contained in:
@@ -38,9 +38,16 @@ static void set_dm_error(int level, const char *file, int line,
|
||||
va_end(va);
|
||||
}
|
||||
|
||||
static int _dm_simple(int task, const char *name);
|
||||
|
||||
static int dm_init(void)
|
||||
{
|
||||
dm_log_init(set_dm_error);
|
||||
if (!_dm_simple(DM_DEVICE_LIST_VERSIONS, "test")) {
|
||||
set_error("Cannot communicate with device-mapper. Is the dm_mod module loaded?");
|
||||
return -1;
|
||||
}
|
||||
|
||||
return 1; /* unsafe memory */
|
||||
}
|
||||
|
||||
|
||||
@@ -705,7 +705,10 @@ static int crypt_job(int (*job)(int arg, struct setup_backend *backend,
|
||||
|
||||
backend = get_setup_backend(default_backend);
|
||||
|
||||
setup_enter(backend,options->icb->log);
|
||||
if (setup_enter(backend,options->icb->log) < 0) {
|
||||
r = -ENOSYS;
|
||||
goto out;
|
||||
}
|
||||
|
||||
if (!backend) {
|
||||
set_error("No setup backend available");
|
||||
|
||||
Reference in New Issue
Block a user