Terminate ddrescue directly instead

This commit is contained in:
2Shirt 2023-07-08 18:10:14 -07:00
parent 8f14fd2442
commit 6a1cf98d0b
Signed by: 2Shirt
GPG key ID: 152FAC923B0E132C

View file

@ -1976,7 +1976,7 @@ def run_ddrescue(state, block_pair, pass_name, settings, dry_run=True) -> None:
warning_message = check_destination_health(state.destination)
if warning_message:
# Error detected on destination, stop recovery
exe.stop_process(proc)
proc.terminate()
cli.print_error(warning_message)
break
_i += 1
@ -1994,7 +1994,7 @@ def run_ddrescue(state, block_pair, pass_name, settings, dry_run=True) -> None:
LOG.warning('ddrescue stopped by user')
warning_message = 'Aborted'
std.sleep(2)
exe.stop_process(proc, graceful=False)
proc.terminate()
break
except subprocess.TimeoutExpired:
# Continue to next loop to update panes