mirror of
https://github.com/martijnvanbrummelen/nwipe.git
synced 2026-02-20 05:32:14 +00:00
Merge pull request #531 from PartialVolume/Fix_no_auto_exit_in_non_gui_mode
Fix nwipe not auto exiting on completion in non gui mode.
This commit is contained in:
62
src/nwipe.c
62
src/nwipe.c
@@ -737,32 +737,6 @@ int main( int argc, char** argv )
|
||||
}
|
||||
}
|
||||
|
||||
/* Kill the temperature update thread */
|
||||
if( nwipe_temperature_thread )
|
||||
{
|
||||
if( nwipe_options.verbose )
|
||||
{
|
||||
nwipe_log( NWIPE_LOG_INFO, "Cancelling the temperature thread." );
|
||||
}
|
||||
|
||||
/* We don't want to use pthread_cancel as our temperature thread is aware of the control-c
|
||||
* signal and will exit itself we just join the temperature thread and wait for confirmation
|
||||
*/
|
||||
r = pthread_join( nwipe_temperature_thread, NULL );
|
||||
if( r != 0 )
|
||||
{
|
||||
nwipe_log( NWIPE_LOG_WARNING,
|
||||
"main()>pthread_join():Error when waiting for temperature thread to cancel." );
|
||||
}
|
||||
else
|
||||
{
|
||||
if( nwipe_options.verbose )
|
||||
{
|
||||
nwipe_log( NWIPE_LOG_INFO, "temperature thread has been cancelled" );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* Release the gui. */
|
||||
if( !nwipe_options.nogui )
|
||||
{
|
||||
@@ -839,6 +813,42 @@ int main( int argc, char** argv )
|
||||
thread_timeout_counter--;
|
||||
sleep( 1 );
|
||||
}
|
||||
|
||||
/* Now all the wipe threads have finished, we can issue a terminate_signal = 1
|
||||
* which will cause the temperature update thread to terminate, this is necessary
|
||||
* because in gui mode the terminate_signal is set when the user presses a key to
|
||||
* exit on completion of all the wipes, however in non gui mode that code isn't
|
||||
* active (being in the gui section) so here we need to set the terminate signal
|
||||
* specifically for a completed wipes/s just for non gui mode.
|
||||
*/
|
||||
terminate_signal = 1;
|
||||
|
||||
/* Kill the temperature update thread */
|
||||
if( nwipe_temperature_thread )
|
||||
{
|
||||
if( nwipe_options.verbose )
|
||||
{
|
||||
nwipe_log( NWIPE_LOG_INFO, "Cancelling the temperature thread." );
|
||||
}
|
||||
|
||||
/* We don't want to use pthread_cancel as our temperature thread is aware of the control-c
|
||||
* signal and will exit itself we just join the temperature thread and wait for confirmation
|
||||
*/
|
||||
r = pthread_join( nwipe_temperature_thread, NULL );
|
||||
if( r != 0 )
|
||||
{
|
||||
nwipe_log( NWIPE_LOG_WARNING,
|
||||
"main()>pthread_join():Error when waiting for temperature thread to cancel." );
|
||||
}
|
||||
else
|
||||
{
|
||||
if( nwipe_options.verbose )
|
||||
{
|
||||
nwipe_log( NWIPE_LOG_INFO, "temperature thread has been cancelled" );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if( nwipe_options.verbose )
|
||||
{
|
||||
for( i = 0; i < nwipe_selected; i++ )
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
* used by configure to dynamically assign those values
|
||||
* to documentation files.
|
||||
*/
|
||||
const char* version_string = "0.35.2";
|
||||
const char* version_string = "0.35.3";
|
||||
const char* program_name = "nwipe";
|
||||
const char* author_name = "Martijn van Brummelen";
|
||||
const char* email_address = "git@brumit.nl";
|
||||
@@ -14,4 +14,4 @@ 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.35.2";
|
||||
const char* banner = "nwipe 0.35.3";
|
||||
|
||||
Reference in New Issue
Block a user