summaryrefslogtreecommitdiffstats
path: root/meta/recipes-devtools
diff options
context:
space:
mode:
authorRoy Li <rongqing.li@windriver.com>2013-09-25 05:58:36 +0000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2013-09-30 22:11:57 +0100
commit4312f5a534bb4029341c076f25ac5be2de69b37f (patch)
treedd7bfa3889882708a39f9dc3832ba2aa6da02573 /meta/recipes-devtools
parent66bf6562d22b9217f1047ead3319f0faa91c2d90 (diff)
downloadast2050-yocto-poky-4312f5a534bb4029341c076f25ac5be2de69b37f.zip
ast2050-yocto-poky-4312f5a534bb4029341c076f25ac5be2de69b37f.tar.gz
makedevs: rectify the exit codes and handle the invalid parameter
It is correct behaviours to output help and version information, and should return 0; When input parameter is invalid, print help information and exit. (From OE-Core rev: 7c61daa08fa51557e0e6785e738646cb5d8de91b) Signed-off-by: Roy Li <rongqing.li@windriver.com> Signed-off-by: Saul Wold <sgw@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-devtools')
-rw-r--r--meta/recipes-devtools/makedevs/makedevs-1.0.0/makedevs.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/meta/recipes-devtools/makedevs/makedevs-1.0.0/makedevs.c b/meta/recipes-devtools/makedevs/makedevs-1.0.0/makedevs.c
index cc3707b..5d2c45b 100644
--- a/meta/recipes-devtools/makedevs/makedevs-1.0.0/makedevs.c
+++ b/meta/recipes-devtools/makedevs/makedevs-1.0.0/makedevs.c
@@ -465,8 +465,8 @@ int main(int argc, char **argv)
error_msg_and_die("%s: not a proper device table file", optarg);
break;
case 'h':
- fprintf(stderr, helptext);
- exit(1);
+ printf(helptext);
+ exit(0);
case 'r':
case 'd': /* for compatibility with mkfs.jffs, genext2fs, etc... */
if (rootdir != default_rootdir) {
@@ -476,8 +476,11 @@ int main(int argc, char **argv)
break;
case 'v':
- fprintf(stderr, "makedevs revision %.*s\n",
+ printf("makedevs revision %.*s\n",
(int) strlen(revtext) - 13, revtext + 11);
+ exit(0);
+ default:
+ fprintf(stderr, helptext);
exit(1);
}
}
OpenPOWER on IntegriCloud