Defensive drive state (#89)

fixes #79

Reviewed-on: #89
Co-authored-by: localhorst <localhorst@mosad.xyz>
Co-committed-by: localhorst <localhorst@mosad.xyz>
This commit is contained in:
2025-12-12 22:46:21 +01:00
committed by Hendrik Schutter
parent 1449e807ad
commit 1dce303ab6
2 changed files with 4 additions and 2 deletions

View File

@ -38,6 +38,10 @@ int Shred::shredDrive(Drive *drive, int *ipSignalFd)
address << (void const *)&(*drive);
Logger::logThis()->info("Shred-Task started - Drive: " + drive->getModelName() + "-" + drive->getSerial() + " @" + address.str());
drive->bWasShredStarted = true; // Mark drive as partly shredded
drive->bWasShredded = false;
drive->setTaskPercentage(0.0);
drive->u32DriveChecksumAfterShredding = UINT32_MAX;
drive->state = Drive::TaskState::SHRED_ACTIVE;
#ifdef DRYRUN
for (int i = 0; i <= 100; i++)