Blame SOURCES/gdisk-0.8.10-exit-code.patch
|
|
93de2e |
From 09cfc620e6d0135efff53cf01499937b0d496dc8 Mon Sep 17 00:00:00 2001
|
|
|
93de2e |
From: "Roderick W. Smith" <rodsmith@rodsbooks.com>
|
|
|
93de2e |
Date: Sat, 29 Mar 2014 00:45:59 -0400
|
|
|
93de2e |
Subject: [PATCH] Fixed bug that caused spurious "1" exit condition in gdisk.
|
|
|
93de2e |
|
|
|
93de2e |
---
|
|
|
93de2e |
gdisk.cc | 7 ++++++-
|
|
|
93de2e |
1 file changed, 6 insertions(+), 1 deletion(-)
|
|
|
93de2e |
|
|
|
93de2e |
diff --git a/gdisk.cc b/gdisk.cc
|
|
|
93de2e |
index b3c6240..5768869 100644
|
|
|
93de2e |
--- a/gdisk.cc
|
|
|
93de2e |
+++ b/gdisk.cc
|
|
|
93de2e |
@@ -15,6 +15,7 @@ int main(int argc, char* argv[]) {
|
|
|
93de2e |
GPTDataTextUI theGPT;
|
|
|
93de2e |
string device = "";
|
|
|
93de2e |
UnicodeString uString;
|
|
|
93de2e |
+ int isError = 0;
|
|
|
93de2e |
|
|
|
93de2e |
cout << "GPT fdisk (gdisk) version " << GPTFDISK_VERSION << "\n\n";
|
|
|
93de2e |
|
|
|
93de2e |
@@ -47,16 +48,20 @@ int main(int argc, char* argv[]) {
|
|
|
93de2e |
device = (string) argv[1];
|
|
|
93de2e |
} else { // 3 arguments, but none is "-l"
|
|
|
93de2e |
cerr << "Usage: " << argv[0] << " [-l] device_file\n";
|
|
|
93de2e |
+ isError = 1;
|
|
|
93de2e |
} // if/elseif/else
|
|
|
93de2e |
if (device != "") {
|
|
|
93de2e |
theGPT.JustLooking();
|
|
|
93de2e |
if (theGPT.LoadPartitions(device))
|
|
|
93de2e |
theGPT.DisplayGPTData();
|
|
|
93de2e |
+ else
|
|
|
93de2e |
+ isError = 1;
|
|
|
93de2e |
} // if
|
|
|
93de2e |
break;
|
|
|
93de2e |
default:
|
|
|
93de2e |
cerr << "Usage: " << argv[0] << " [-l] device_file\n";
|
|
|
93de2e |
+ isError = 1;
|
|
|
93de2e |
break;
|
|
|
93de2e |
} // switch
|
|
|
93de2e |
- return 1 ;
|
|
|
93de2e |
+ return (isError);
|
|
|
93de2e |
} // main
|
|
|
93de2e |
--
|
|
|
93de2e |
2.17.2
|
|
|
93de2e |
|