Disable delete after shred was once started. (#69)

documented here: localhorst/reHDD#65

Reviewed-on: localhorst/reHDD#69
Co-authored-by: localhorst <localhorst@mosad.xyz>
Co-committed-by: localhorst <localhorst@mosad.xyz>
This commit is contained in:
2024-08-16 10:26:49 +02:00
committed by Hendrik Schutter
parent 6dd4c44688
commit 1055ef57ee
3 changed files with 12 additions and 5 deletions

View File

@ -32,11 +32,15 @@ void Delete::deleteDrive(Drive *drive)
const char *cpComand = sCMD.c_str();
// cout << "delete: " << cpComand << endl;
FILE *deleteCmdOutput = popen(cpComand, "r");
while ((getline(&cLine, &len, deleteCmdOutput)) != -1)
if (drive->bWasShredStarted == false)
{
// wipefs running
//only start delete if the drive was not shredded before
FILE *deleteCmdOutput = popen(cpComand, "r");
while ((getline(&cLine, &len, deleteCmdOutput)) != -1)
{
// wipefs running
}
pclose(deleteCmdOutput);
}
pclose(deleteCmdOutput);
}