diff --git a/NEWS b/NEWS index c1ad438..fd2338f 100644 --- a/NEWS +++ b/NEWS @@ -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. diff --git a/gptcl.cc b/gptcl.cc index 94709ec..2044244 100644 --- a/gptcl.cc +++ b/gptcl.cc @@ -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";