From: Roy Li Date: Wed, 25 Sep 2013 05:58:36 +0000 (+0000) Subject: makedevs: rectify the exit codes and handle the invalid parameter X-Git-Tag: rev_ivi_2015_02_04~10849 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=3725df41dcebdecb0eb4faba307ed31d41ed2394;p=scm%2Fbb%2Ftizen-distro.git 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 Signed-off-by: Saul Wold Signed-off-by: Richard Purdie --- 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); } }