Fixed bug that caused sgdisk to not return an appropriate error code

(4) when it encountered write errors under some circumstances.
This commit is contained in:
Roderick W. Smith
2015-10-17 18:37:07 -04:00
parent c14a28426f
commit bdae070734
2 changed files with 5 additions and 1 deletions

3
NEWS
View File

@@ -1,6 +1,9 @@
1.0.1 (?/??/2015):
------------------
- Fixed bug that caused sgdisk to not return an appropriate error code
when it encountered a write error when saving changes.
- Fixed bug that caused cgdisk's "Info" display to under-report the
partition's size by one sector.

View File

@@ -463,7 +463,8 @@ int GPTDataCL::DoOptions(int argc, char* argv[]) {
retval = 2;
} // if/else loaded OK
if ((saveData) && (!neverSaveData) && (saveNonGPT) && (!pretend)) {
SaveGPTData(1);
if (!SaveGPTData(1))
retval = 4;
}
if (saveData && (!saveNonGPT)) {
cout << "Non-GPT disk; not saving changes. Use -g to override.\n";