Commit partition table when closing Sfdisk backend device.
This commit is contained in:
parent
41570fde5d
commit
590b531863
|
@ -31,6 +31,7 @@ SfdiskDevice::SfdiskDevice(const Device& d) :
|
||||||
|
|
||||||
SfdiskDevice::~SfdiskDevice()
|
SfdiskDevice::~SfdiskDevice()
|
||||||
{
|
{
|
||||||
|
close();
|
||||||
}
|
}
|
||||||
|
|
||||||
bool SfdiskDevice::open()
|
bool SfdiskDevice::open()
|
||||||
|
@ -50,19 +51,16 @@ bool SfdiskDevice::close()
|
||||||
if (isExclusive())
|
if (isExclusive())
|
||||||
setExclusive(false);
|
setExclusive(false);
|
||||||
|
|
||||||
|
CoreBackendPartitionTable* ptable = new SfdiskPartitionTable(m_device);
|
||||||
|
ptable->commit();
|
||||||
|
delete ptable;
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
CoreBackendPartitionTable* SfdiskDevice::openPartitionTable()
|
CoreBackendPartitionTable* SfdiskDevice::openPartitionTable()
|
||||||
{
|
{
|
||||||
CoreBackendPartitionTable* ptable = new SfdiskPartitionTable(m_device);
|
return new SfdiskPartitionTable(m_device);
|
||||||
|
|
||||||
if (ptable == nullptr || !ptable->open()) {
|
|
||||||
delete ptable;
|
|
||||||
ptable = nullptr;
|
|
||||||
}
|
|
||||||
|
|
||||||
return ptable;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
bool SfdiskDevice::createPartitionTable(Report& report, const PartitionTable& ptable)
|
bool SfdiskDevice::createPartitionTable(Report& report, const PartitionTable& ptable)
|
||||||
|
|
Loading…
Reference in New Issue