[Gptfdisk-general] [PATCH 2/4] if there is any error, report it via return value
Brought to you by:
srs5694
|
From: Cody P S. <de...@co...> - 2015-06-17 21:36:49
|
---
gptcl.cc | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/gptcl.cc b/gptcl.cc
index 94709ec..7232a02 100644
--- a/gptcl.cc
+++ b/gptcl.cc
@@ -463,7 +463,10 @@ int GPTDataCL::DoOptions(int argc, char* argv[]) {
retval = 2;
} // if/else loaded OK
if ((saveData) && (!neverSaveData) && (saveNonGPT) && (!pretend)) {
- SaveGPTData(1);
+ if (!SaveGPTData(1)) {
+ cout << "Error encountered; partial data may be written";
+ retval = 5;
+ }
}
if (saveData && (!saveNonGPT)) {
cout << "Non-GPT disk; not saving changes. Use -g to override.\n";
--
2.4.3
|