Skip to content

Commit

Permalink
firmware-tools/ptgen: use portable exit codes
Browse files Browse the repository at this point in the history
Signed-off-by: Michael Heimpold <[email protected]>
  • Loading branch information
mhei authored and blogic committed Jan 2, 2018
1 parent 83f729d commit 4982859
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions tools/firmware-utils/src/ptgen.c
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@ static int gen_ptable(uint32_t signature, int nr)
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)
Expand All @@ -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;
Expand Down Expand Up @@ -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;
}

0 comments on commit 4982859

Please sign in to comment.