diff options
author | srs5694 <srs5694@users.sourceforge.net> | 2011-03-21 21:33:57 -0400 |
---|---|---|
committer | srs5694 <srs5694@users.sourceforge.net> | 2011-03-21 21:33:57 -0400 |
commit | 699941e25a1fcf0beec124203747c8ed20842989 (patch) | |
tree | eb2629231de8c6a973e3ef449fab80082b87a9ae /gpt.cc | |
parent | 815fb65195106b8afe1b8dfec5dae605dbd7ccbe (diff) | |
download | sgdisk-699941e25a1fcf0beec124203747c8ed20842989.tar.gz |
0.7.1 release version
Diffstat (limited to 'gpt.cc')
-rw-r--r-- | gpt.cc | 9 |
1 files changed, 7 insertions, 2 deletions
@@ -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 |