mirror of
https://gitlab.com/cryptsetup/cryptsetup.git
synced 2025-12-11 19:00:02 +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 */
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user