Try to read first sector from device to properly check that device is ready.

git-svn-id: https://cryptsetup.googlecode.com/svn/trunk@106 36d66b0a-2a48-0410-832c-cd162a569da5
This commit is contained in:
Milan Broz
2009-09-08 10:29:50 +00:00
parent a47856ac49
commit dfadce6d80
4 changed files with 23 additions and 13 deletions

View File

@@ -133,7 +133,7 @@ static struct interface_callbacks cmd_icb = {
static void show_status(int errcode)
{
char error[256];
char error[256], *error_;
if(!errcode && opt_verbose) {
log_std(_("Command successful.\n"));
@@ -142,11 +142,11 @@ static void show_status(int errcode)
crypt_get_error(error, sizeof(error));
if (!opt_verbose) {
char *error_ = strerror_r(errcode, error, sizeof(error));
if (!error[0]) {
error_ = strerror_r(errcode, error, sizeof(error));
if (error_ != error) {
strncpy(error, error_, sizeof(error));
error[sizeof error - 1] = '\0';
error[sizeof(error) - 1] = '\0';
}
}