[source] firmware-tools/ptgen: use portable exit codes

LEDE Commits lede-commits at lists.infradead.org
Mon Jan 1 22:14:28 PST 2018


blogic pushed a commit to source.git, branch master:
https://git.lede-project.org/498285922e19d1df55ddef204caced48fef26135

commit 498285922e19d1df55ddef204caced48fef26135
Author: Michael Heimpold <mhei at heimpold.de>
AuthorDate: Thu Dec 21 23:59:30 2017 +0100

    firmware-tools/ptgen: use portable exit codes
    
    Signed-off-by: Michael Heimpold <mhei at heimpold.de>
---
 tools/firmware-utils/src/ptgen.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/tools/firmware-utils/src/ptgen.c b/tools/firmware-utils/src/ptgen.c
index 93d66eb..13e0eda 100644
--- a/tools/firmware-utils/src/ptgen.c
+++ b/tools/firmware-utils/src/ptgen.c
@@ -197,7 +197,7 @@ fail:
 static void usage(char *prog)
 {
 	fprintf(stderr, "Usage: %s [-v] -h <heads> -s <sectors> -o <outputfile> [-a 0..4] [-l <align kB>] [[-t <type>] -p <size>...] \n", prog);
-	exit(1);
+	exit(EXIT_FAILURE);
 }
 
 int main (int argc, char **argv)
@@ -224,7 +224,7 @@ int main (int argc, char **argv)
 		case 'p':
 			if (part > 3) {
 				fprintf(stderr, "Too many partitions\n");
-				exit(1);
+				exit(EXIT_FAILURE);
 			}
 			parts[part].size = to_kbytes(optarg);
 			parts[part++].type = type;
@@ -252,5 +252,5 @@ int main (int argc, char **argv)
 	if (argc || (heads <= 0) || (sectors <= 0) || !filename)
 		usage(argv[0]);
 
-	return gen_ptable(signature, part);
+	return gen_ptable(signature, part) ? EXIT_FAILURE : EXIT_SUCCESS;
 }



More information about the lede-commits mailing list