fix DRYRUN shred

This commit is contained in:
2025-12-12 22:06:45 +01:00
parent 04a33335c8
commit 7ce6986d92
2 changed files with 5 additions and 10 deletions

View File

@ -226,10 +226,10 @@ void reHDD::ThreadShred(Drive *const pDrive)
{
if (pDrive != nullptr)
{
pDrive->setActionStartTimestamp(); // save timestamp at start of shredding
Shred *pShredTask = new Shred(); // create new shred task
pShredTask->shredDrive(pDrive, &fdShredInformPipe[1]); // start new shred task
delete pShredTask; // delete shred task
pDrive->setActionStartTimestamp(); // save timestamp at start of shredding
Shred *pShredInstance = new Shred(); // create new shred task
pShredInstance->shredDrive(pDrive, &fdShredInformPipe[1]); // start new shred task
delete pShredInstance; // delete shred task
ui->updateTUI(&listDrives, u16SelectedEntry);
}
}

View File

@ -42,10 +42,6 @@ int Shred::shredDrive(Drive *drive, int *ipSignalFd)
#ifdef DRYRUN
for (int i = 0; i <= 100; i++)
{
if (drive->state.load() != Drive::TaskState::SHRED_ACTIVE)
{
return 0;
}
drive->setTaskPercentage(i + 0.05);
write(*ipSignalFd, "A", 1);
usleep(20000);
@ -204,9 +200,8 @@ int Shred::shredDrive(Drive *drive, int *ipSignalFd)
Logger::logThis()->info("Shred-Task: Checksum zero: " + to_string(drive->u32DriveChecksumAfterShredding) + " - Drive: " + drive->getSerial());
}
#endif
#endif
cleanup();
#endif
if ((drive->state.load() == Drive::TaskState::SHRED_ACTIVE) || (drive->state.load() == Drive::TaskState::CHECK_SUCCESSFUL) || (drive->state == Drive::TaskState::CHECK_FAILED))
{