From patchwork Mon Nov 11 18:29:51 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Armin Kuster X-Patchwork-Id: 179102 Delivered-To: patch@linaro.org Received: by 2002:a92:38d5:0:0:0:0:0 with SMTP id g82csp7022613ilf; Mon, 11 Nov 2019 10:31:23 -0800 (PST) X-Google-Smtp-Source: APXvYqwq6G26IVMvDyonWnYiRrOSSwfh6GV64lHKLFW6N4QrSo8/2/JkWCh+juJoOzd3XDw6O08C X-Received: by 2002:a17:902:6b0a:: with SMTP id o10mr20388719plk.15.1573497082878; Mon, 11 Nov 2019 10:31:22 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1573497082; cv=none; d=google.com; s=arc-20160816; b=TeNkSzxc1QCXPyP5vteabTtXu0BQ+cjsUMtxO54rNkivdTNNC+tLI9YjeO1kyihkTF V3s5aUktnLiY4mqznycbdmHciyNDLdTYtsGFcUln15tV7mzsx2+FjGvhQCgWz9wKbqLS ZbwTvRYz+Wz46hxDqw2iNx5Ya/6GNYJNXs+axaXbPxjoHJdexuqyAzz2c0C/JLRURjM7 EmapBNTArL30OSLM50Am4RkT4QvjbRj4UZ4bFiUY5DQEosWzoXvEkHCbjiD907L0lJ36 uEfKD0D/qG5eme3BagG8HuZ+xv/AhTV9qfcVervq4nxEr8CeZfP2sZCm99+zj6vnPs0v XPFw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=errors-to:sender:content-transfer-encoding:mime-version :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:subject:references:in-reply-to:message-id:date :to:from:dkim-signature:delivered-to; bh=WkOyWvDZXtUpDjz0zSX7KMaEDWkhd8gWadnPsA7ncaI=; b=MXrfyusNThRljHRTKvhGQ03wSo2JYUudgJJVa72yYcbpJ2SA2HMeGB2W5KVW2F6YiM CA7dOyrWf2OkgBWWepG3QwcOR1DrNeX4o1CmNz49c/twhweCqrFhmsVNGvs77AJuZxN5 m6is4eFDBvRs4g0g6K4m8LFuxGWPagbZKWAZ9u9v/ow9WcsHCVPbdQxSHge0qYXkO0Hb SlXDUq7W1x+yblXjtCLaHEygGZijn7uPlpiwQkylKV5HVcoYVll2uIGBnfcgjyWnoY3K XjqibfGwXXQfyP63D475DeIYLLMEPdKUX/+AU2hVwCN1Jy37Ij6Q9RCrM5fRHHafBzfS ATlA== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@gmail.com header.s=20161025 header.b=cE4nsdwh; spf=pass (google.com: best guess record for domain of openembedded-core-bounces@lists.openembedded.org designates 140.211.169.62 as permitted sender) smtp.mailfrom=openembedded-core-bounces@lists.openembedded.org; dmarc=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from mail.openembedded.org (mail.openembedded.org. [140.211.169.62]) by mx.google.com with ESMTP id 20si18418744pge.331.2019.11.11.10.31.22; Mon, 11 Nov 2019 10:31:22 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of openembedded-core-bounces@lists.openembedded.org designates 140.211.169.62 as permitted sender) client-ip=140.211.169.62; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@gmail.com header.s=20161025 header.b=cE4nsdwh; spf=pass (google.com: best guess record for domain of openembedded-core-bounces@lists.openembedded.org designates 140.211.169.62 as permitted sender) smtp.mailfrom=openembedded-core-bounces@lists.openembedded.org; dmarc=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from ec2-34-214-78-129.us-west-2.compute.amazonaws.com (localhost [127.0.0.1]) by mail.openembedded.org (Postfix) with ESMTP id 4086E7FC4A; Mon, 11 Nov 2019 18:30:31 +0000 (UTC) X-Original-To: openembedded-core@lists.openembedded.org Delivered-To: openembedded-core@lists.openembedded.org Received: from mail-pg1-f171.google.com (mail-pg1-f171.google.com [209.85.215.171]) by mail.openembedded.org (Postfix) with ESMTP id 8BD157FAB6 for ; Mon, 11 Nov 2019 18:30:16 +0000 (UTC) Received: by mail-pg1-f171.google.com with SMTP id z24so9961518pgu.4 for ; Mon, 11 Nov 2019 10:30:17 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:subject:date:message-id:in-reply-to:references; bh=6rb/J/AEYQhuTLPYkxMkPGBjGOBNYO33YGlscNFOcyc=; b=cE4nsdwhlfUuH2cLo3c2NOzRTrBVSPl5SB7+pa+Qaa6VLAKRFPxR8QPYzfheK4Mg+N MGHbn0Yz3BcD0FjRPzjrEFQSz7OFGQP4nb9C32B+arrNH+sdyUbpSp5qHG2iQ+XjhlhC JQcd+2qXCCHuQPwBMECrMVrHMDzJj+SmK1s1iHslqFNH9W5XNvPKOiLyZWdj2RkZViz5 eEhrfFGC5zZSkvd+STCuMlTGu4CsIyY+yK2Q2OFriAjEDWiX093NlmmdYGX2PaaplEeS XcMP8xJnsgY/vZi1ocysn9WwSL/PDsDfzwnwQjvTD666b1xhFZhYrG0qpE6DitMLiS9c jVYg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references; bh=6rb/J/AEYQhuTLPYkxMkPGBjGOBNYO33YGlscNFOcyc=; b=Tp783rQEnBvFLx4IwnKeudxAjxhTxzQFmQw7YBQ/745UySH+9pzBgvuWESbMVJuXYV 9yr/SevuO0F8Mrpz+jT9Edm4tlDzRbJl1RneO/w0uTLE8jFBpR+6Z6PP6iajA83q2cTr UTr4+KdObQSU2YWc3TzxwqGdK+CglseFFJ9r6tPWhcq8MMD095rpIsRRJSOx+ooQYgUU Io0eTswILwtCtDQiyTjrYZeOcz6Rjlu9BXxhoKMWbv/IMpG1M1DyN/nvgtv/1CQXca6L ZLF8qLfGhfSzvzgGDZoeEyVuUqZ6gSOdfvPmtydNThOaf69HT6ERcL5jMqFYM9vwazEI NhYA== X-Gm-Message-State: APjAAAUNude0r+fuXPbwveCHY3EPxKY47MsHR1H1+3+xTHeZQJZYvxH8 dQoLJOozIM27S2X/k5czePyE3Fr2 X-Received: by 2002:a17:90a:1782:: with SMTP id q2mr489874pja.57.1573497017249; Mon, 11 Nov 2019 10:30:17 -0800 (PST) Received: from akuster-ThinkPad-T460s.mvista.com ([2601:202:4180:a5c0:604a:b703:29ca:5c7d]) by smtp.gmail.com with ESMTPSA id l62sm17731698pgl.24.2019.11.11.10.30.16 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 11 Nov 2019 10:30:16 -0800 (PST) From: Armin Kuster To: openembedded-core@lists.openembedded.org Date: Mon, 11 Nov 2019 10:29:51 -0800 Message-Id: X-Mailer: git-send-email 2.7.4 In-Reply-To: References: Subject: [OE-core] [zeus 09/21] qemu-helper-native: showing help shouldn't be an error X-BeenThere: openembedded-core@lists.openembedded.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: Patches and discussions about the oe-core layer List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: openembedded-core-bounces@lists.openembedded.org Errors-To: openembedded-core-bounces@lists.openembedded.org From: Ross Burton Displaying a help message if help was requested isn't an error. Signed-off-by: Ross Burton Signed-off-by: Armin Kuster --- meta/recipes-devtools/qemu/qemu-helper/tunctl.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) -- 2.7.4 -- _______________________________________________ Openembedded-core mailing list Openembedded-core@lists.openembedded.org http://lists.openembedded.org/mailman/listinfo/openembedded-core diff --git a/meta/recipes-devtools/qemu/qemu-helper/tunctl.c b/meta/recipes-devtools/qemu/qemu-helper/tunctl.c index fc00e99..d745dd0 100644 --- a/meta/recipes-devtools/qemu/qemu-helper/tunctl.c +++ b/meta/recipes-devtools/qemu/qemu-helper/tunctl.c @@ -19,7 +19,7 @@ #define TUNSETGROUP _IOW('T', 206, int) #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] " "[-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" " use\n/dev/misc/net/tun instead\n\n"); fprintf(stderr, "-b will result in brief output (just the device name)\n"); - exit(1); + exit(status); } int main(int argc, char **argv) @@ -63,7 +63,7 @@ int main(int argc, char **argv) if(*end != '\0'){ fprintf(stderr, "'%s' is neither a username nor a numeric uid.\n", optarg); - Usage(name); + Usage(name, 1); } break; case 'g': @@ -76,7 +76,7 @@ int main(int argc, char **argv) if(*end != '\0'){ fprintf(stderr, "'%s' is neither a groupname nor a numeric group.\n", optarg); - Usage(name); + Usage(name, 1); } break; @@ -84,8 +84,10 @@ int main(int argc, char **argv) tun = optarg; break; case 'h': + Usage(name, 0); + break; default: - Usage(name); + Usage(name, 1); } } @@ -93,7 +95,7 @@ int main(int argc, char **argv) argc -= optind; if(argc > 0) - Usage(name); + Usage(name, 1); if((tap_fd = open(file, O_RDWR)) < 0){ fprintf(stderr, "Failed to open '%s' : ", file);