mirror of
https://git.yoctoproject.org/poky
synced 2026-06-02 01:19:52 +00:00
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>
This commit is contained in:
committed by
Richard Purdie
parent
6c50928df6
commit
c1fbd56f01
@@ -19,7 +19,7 @@
|
|||||||
#define TUNSETGROUP _IOW('T', 206, int)
|
#define TUNSETGROUP _IOW('T', 206, int)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
static void Usage(char *name)
|
static void Usage(char *name, int status)
|
||||||
{
|
{
|
||||||
fprintf(stderr, "Create: %s [-b] [-u owner] [-g group] [-t device-name] "
|
fprintf(stderr, "Create: %s [-b] [-u owner] [-g group] [-t device-name] "
|
||||||
"[-f tun-clone-device]\n", name);
|
"[-f tun-clone-device]\n", name);
|
||||||
@@ -28,7 +28,7 @@ static void Usage(char *name)
|
|||||||
fprintf(stderr, "The default tun clone device is /dev/net/tun - some systems"
|
fprintf(stderr, "The default tun clone device is /dev/net/tun - some systems"
|
||||||
" use\n/dev/misc/net/tun instead\n\n");
|
" use\n/dev/misc/net/tun instead\n\n");
|
||||||
fprintf(stderr, "-b will result in brief output (just the device name)\n");
|
fprintf(stderr, "-b will result in brief output (just the device name)\n");
|
||||||
exit(1);
|
exit(status);
|
||||||
}
|
}
|
||||||
|
|
||||||
int main(int argc, char **argv)
|
int main(int argc, char **argv)
|
||||||
@@ -63,7 +63,7 @@ int main(int argc, char **argv)
|
|||||||
if(*end != '\0'){
|
if(*end != '\0'){
|
||||||
fprintf(stderr, "'%s' is neither a username nor a numeric uid.\n",
|
fprintf(stderr, "'%s' is neither a username nor a numeric uid.\n",
|
||||||
optarg);
|
optarg);
|
||||||
Usage(name);
|
Usage(name, 1);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 'g':
|
case 'g':
|
||||||
@@ -76,7 +76,7 @@ int main(int argc, char **argv)
|
|||||||
if(*end != '\0'){
|
if(*end != '\0'){
|
||||||
fprintf(stderr, "'%s' is neither a groupname nor a numeric group.\n",
|
fprintf(stderr, "'%s' is neither a groupname nor a numeric group.\n",
|
||||||
optarg);
|
optarg);
|
||||||
Usage(name);
|
Usage(name, 1);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
@@ -84,8 +84,10 @@ int main(int argc, char **argv)
|
|||||||
tun = optarg;
|
tun = optarg;
|
||||||
break;
|
break;
|
||||||
case 'h':
|
case 'h':
|
||||||
|
Usage(name, 0);
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
Usage(name);
|
Usage(name, 1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -93,7 +95,7 @@ int main(int argc, char **argv)
|
|||||||
argc -= optind;
|
argc -= optind;
|
||||||
|
|
||||||
if(argc > 0)
|
if(argc > 0)
|
||||||
Usage(name);
|
Usage(name, 1);
|
||||||
|
|
||||||
if((tap_fd = open(file, O_RDWR)) < 0){
|
if((tap_fd = open(file, O_RDWR)) < 0){
|
||||||
fprintf(stderr, "Failed to open '%s' : ", file);
|
fprintf(stderr, "Failed to open '%s' : ", file);
|
||||||
|
|||||||
Reference in New Issue
Block a user