From 91cf3950df776c2a89d0630d7fd3bc5bef53a6ee Mon Sep 17 00:00:00 2001 From: Teo Mrnjavac Date: Sat, 20 Jun 2015 19:28:36 +0200 Subject: [PATCH] Clear swap partitions after swapoffing them. --- src/modules/partition/jobs/ClearMountsJob.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/modules/partition/jobs/ClearMountsJob.cpp b/src/modules/partition/jobs/ClearMountsJob.cpp index b5ae36a4a..c3e187dd3 100644 --- a/src/modules/partition/jobs/ClearMountsJob.cpp +++ b/src/modules/partition/jobs/ClearMountsJob.cpp @@ -156,7 +156,13 @@ ClearMountsJob::tryUmount( const QString& partPath ) process.start( "swapoff", { partPath } ); process.waitForFinished(); if ( process.exitCode() == 0 ) - return QString( "Successfully disabled swap %1." ).arg( partPath ); + { + process.start( "mkswap", { partPath } ); + process.waitForFinished(); + if ( process.exitCode() == 0 ) + return QString( "Successfully disabled and cleared swap %1." ).arg( partPath ); + return QString( "Successfully disabled but not cleared swap %1." ).arg( partPath ); + } return QString(); }