Merge pull request #317 from PartialVolume/Fix_contradictory_log_messaging

Fixes contradictory log messages.
This commit is contained in:
PartialVolume
2021-05-27 08:18:29 +01:00
committed by GitHub
4 changed files with 17 additions and 8 deletions

View File

@@ -711,7 +711,7 @@ void nwipe_log_summary( nwipe_context_t** ptr, int nwipe_selected )
else
{
if( c[i]->pass_errors != 0 )
if( c[i]->pass_errors != 0 || c[i]->verify_errors != 0 )
{
strncpy( exclamation_flag, "!", 1 );
exclamation_flag[1] = 0;

View File

@@ -1066,7 +1066,14 @@ int nwipe_runmethod( nwipe_context_t* c, nwipe_pattern_t* patterns )
}
}
nwipe_log( NWIPE_LOG_NOTICE, "[SUCCESS] Blanked device %s", c->device_name );
if( c->verify_errors == 0 && c->pass_errors == 0 )
{
nwipe_log( NWIPE_LOG_NOTICE, "[SUCCESS] Blanked device %s", c->device_name );
}
else
{
nwipe_log( NWIPE_LOG_NOTICE, "[FAILURE] %s may not be blanked", c->device_name );
}
} /* final blank */

View File

@@ -91,8 +91,9 @@ int main( int argc, char** argv )
/* Initialise, flag indicating whether a wipe has actually started or not 0=no, 1=yes */
global_wipe_status = 0;
/* Initialise, flag that indicates whether a fatal error occured on ANY drive */
/* Initialise flags that indicates whether a fatal or non fatal error occured on ANY drive */
int fatal_errors_flag = 0;
int non_fatal_errors_flag = 0;
/* Two arrays are used, containing pointers to the the typedef for each disk */
/* The first array (c1) points to all devices, the second points to only */
@@ -592,6 +593,7 @@ int main( int argc, char** argv )
if( c2[i]->result > 0 )
{
nwipe_log( NWIPE_LOG_FATAL, "Nwipe exited with non fatal errors on device = %s\n", c2[i]->device_name );
non_fatal_errors_flag = 1;
return_status = 1;
}
}
@@ -628,10 +630,10 @@ int main( int argc, char** argv )
}
else
{
if( fatal_errors_flag == 1 )
if( fatal_errors_flag == 1 || non_fatal_errors_flag == 1 )
{
nwipe_log( NWIPE_LOG_INFO,
"Nwipe exited with fatal errors, check the summary table for individual drive status." );
"Nwipe exited with errors, check the log & summary table for individual drive status." );
}
else
{

View File

@@ -4,14 +4,14 @@
* used by configure to dynamically assign those values
* to documentation files.
*/
const char* version_string = "0.30.003";
const char* version_string = "0.30.004";
const char* program_name = "nwipe";
const char* author_name = "Martijn van Brummelen";
const char* email_address = "git@brumit.nl";
const char* years = "2020";
const char* years = "2021";
const char* copyright = "Copyright Darik Horn <dajhorn-dban@vanadac.com>\n\
Modifications to original dwipe Copyright Andy Beverley <andy@andybev.com>\n\
This is free software; see the source for copying conditions.\n\
There is NO warranty; not even for MERCHANTABILITY or FITNESS\n\
FOR A PARTICULAR PURPOSE.\n";
const char* banner = "nwipe 0.30.003";
const char* banner = "nwipe 0.30.004";