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-04 13:39:04 +0000 |
commit | cb8fbf5d92aae04527d71384538236f1359a1aba (patch) | |
tree | d5492f29e4f004d2063329e0926dd8335df65f95 /meta/recipes-devtools/qemu | |
parent | a348b3aa77a319c6384ae059e0c8197e7aa6efa8 (diff) | |
download | poky-cb8fbf5d92aae04527d71384538236f1359a1aba.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: 9d98e881de9030d80e451519b054681d4e9d2621)
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-devtools/qemu')
-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); |