diff options
| author | Ross Burton <ross.burton@intel.com> | 2019-10-14 15:08:43 +0100 |
|---|---|---|
| committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2019-11-13 22:02:16 +0000 |
| commit | c1fbd56f01f26323a3ccd27625d774bcbffd0a73 (patch) | |
| tree | 3471023d68083a25ac341e3103dad9f9127a63a7 /meta/recipes-devtools | |
| parent | 6c50928df6d68119457d7be2a0ecaa518c217641 (diff) | |
| download | poky-c1fbd56f01f26323a3ccd27625d774bcbffd0a73.tar.gz | |
qemu-helper-native: showing help shouldn't be an error
Displaying a help message if help was requested isn't an error.
(From OE-Core rev: a1d9cfef7f247d616cd6ca482916ad0469e4fc58)
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Armin Kuster <akuster808@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-devtools')
| -rw-r--r-- | meta/recipes-devtools/qemu/qemu-helper/tunctl.c | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/meta/recipes-devtools/qemu/qemu-helper/tunctl.c b/meta/recipes-devtools/qemu/qemu-helper/tunctl.c index fc00e99789..d745dd06cb 100644 --- a/meta/recipes-devtools/qemu/qemu-helper/tunctl.c +++ b/meta/recipes-devtools/qemu/qemu-helper/tunctl.c | |||
| @@ -19,7 +19,7 @@ | |||
| 19 | #define TUNSETGROUP _IOW('T', 206, int) | 19 | #define TUNSETGROUP _IOW('T', 206, int) |
| 20 | #endif | 20 | #endif |
| 21 | 21 | ||
| 22 | static void Usage(char *name) | 22 | static void Usage(char *name, int status) |
| 23 | { | 23 | { |
| 24 | fprintf(stderr, "Create: %s [-b] [-u owner] [-g group] [-t device-name] " | 24 | fprintf(stderr, "Create: %s [-b] [-u owner] [-g group] [-t device-name] " |
| 25 | "[-f tun-clone-device]\n", name); | 25 | "[-f tun-clone-device]\n", name); |
| @@ -28,7 +28,7 @@ static void Usage(char *name) | |||
| 28 | fprintf(stderr, "The default tun clone device is /dev/net/tun - some systems" | 28 | fprintf(stderr, "The default tun clone device is /dev/net/tun - some systems" |
| 29 | " use\n/dev/misc/net/tun instead\n\n"); | 29 | " use\n/dev/misc/net/tun instead\n\n"); |
| 30 | fprintf(stderr, "-b will result in brief output (just the device name)\n"); | 30 | fprintf(stderr, "-b will result in brief output (just the device name)\n"); |
| 31 | exit(1); | 31 | exit(status); |
| 32 | } | 32 | } |
| 33 | 33 | ||
| 34 | int main(int argc, char **argv) | 34 | int main(int argc, char **argv) |
| @@ -63,7 +63,7 @@ int main(int argc, char **argv) | |||
| 63 | if(*end != '\0'){ | 63 | if(*end != '\0'){ |
| 64 | fprintf(stderr, "'%s' is neither a username nor a numeric uid.\n", | 64 | fprintf(stderr, "'%s' is neither a username nor a numeric uid.\n", |
| 65 | optarg); | 65 | optarg); |
| 66 | Usage(name); | 66 | Usage(name, 1); |
| 67 | } | 67 | } |
| 68 | break; | 68 | break; |
| 69 | case 'g': | 69 | case 'g': |
| @@ -76,7 +76,7 @@ int main(int argc, char **argv) | |||
| 76 | if(*end != '\0'){ | 76 | if(*end != '\0'){ |
| 77 | fprintf(stderr, "'%s' is neither a groupname nor a numeric group.\n", | 77 | fprintf(stderr, "'%s' is neither a groupname nor a numeric group.\n", |
| 78 | optarg); | 78 | optarg); |
| 79 | Usage(name); | 79 | Usage(name, 1); |
| 80 | } | 80 | } |
| 81 | break; | 81 | break; |
| 82 | 82 | ||
| @@ -84,8 +84,10 @@ int main(int argc, char **argv) | |||
| 84 | tun = optarg; | 84 | tun = optarg; |
| 85 | break; | 85 | break; |
| 86 | case 'h': | 86 | case 'h': |
| 87 | Usage(name, 0); | ||
| 88 | break; | ||
| 87 | default: | 89 | default: |
| 88 | Usage(name); | 90 | Usage(name, 1); |
| 89 | } | 91 | } |
| 90 | } | 92 | } |
| 91 | 93 | ||
| @@ -93,7 +95,7 @@ int main(int argc, char **argv) | |||
| 93 | argc -= optind; | 95 | argc -= optind; |
| 94 | 96 | ||
| 95 | if(argc > 0) | 97 | if(argc > 0) |
| 96 | Usage(name); | 98 | Usage(name, 1); |
| 97 | 99 | ||
| 98 | if((tap_fd = open(file, O_RDWR)) < 0){ | 100 | if((tap_fd = open(file, O_RDWR)) < 0){ |
| 99 | fprintf(stderr, "Failed to open '%s' : ", file); | 101 | fprintf(stderr, "Failed to open '%s' : ", file); |
