mirror of
https://gitlab.com/cryptsetup/cryptsetup.git
synced 2025-12-14 12:20:00 +01:00
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:
@@ -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';
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user