summaryrefslogtreecommitdiff
path: root/gpt.cc
diff options
context:
space:
mode:
authorsrs5694 <srs5694@users.sourceforge.net>2011-03-21 21:33:57 -0400
committersrs5694 <srs5694@users.sourceforge.net>2011-03-21 21:33:57 -0400
commit699941e25a1fcf0beec124203747c8ed20842989 (patch)
treeeb2629231de8c6a973e3ef449fab80082b87a9ae /gpt.cc
parent815fb65195106b8afe1b8dfec5dae605dbd7ccbe (diff)
downloadsgdisk-699941e25a1fcf0beec124203747c8ed20842989.tar.gz
0.7.1 release version
Diffstat (limited to 'gpt.cc')
-rw-r--r--gpt.cc9
1 files changed, 7 insertions, 2 deletions
diff --git a/gpt.cc b/gpt.cc
index ea0a0a3..9c62f4e 100644
--- a/gpt.cc
+++ b/gpt.cc
@@ -1057,6 +1057,7 @@ int GPTData::SaveGPTBackup(const string & filename) {
RecomputeCRCs();
protectiveMBR.WriteMBRData(&backupFile);
+ protectiveMBR.SetDisk(&myDisk);
if (allOK) {
// MBR write closed disk, so re-open and seek to end....
@@ -1768,12 +1769,16 @@ void GPTData::MoveSecondHeaderToEnd() {
secondHeader.partitionEntriesLBA = secondHeader.lastUsableLBA + UINT64_C(1);
} // GPTData::FixSecondHeaderLocation()
+// Sets the partition's name to the specified UnicodeString without
+// user interaction.
+// Returns 1 on success, 0 on failure (invalid partition number).
int GPTData::SetName(uint32_t partNum, const UnicodeString & theName) {
int retval = 1;
- if (!IsFreePartNum(partNum)) {
+ if (IsUsedPartNum(partNum))
partitions[partNum].SetName(theName);
- } else retval = 0;
+ else
+ retval = 0;
return retval;
} // GPTData::SetName