From patchwork Wed Nov 13 15:32:01 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Armin Kuster X-Patchwork-Id: 179326 Delivered-To: patch@linaro.org Received: by 2002:a92:38d5:0:0:0:0:0 with SMTP id g82csp9762604ilf; Wed, 13 Nov 2019 07:35:38 -0800 (PST) X-Google-Smtp-Source: APXvYqwnxrwbL60CHVxwcH09xsoiaaB7g0RAO6dWnV7wqKrc0pFhhpFwRoC91i5vgRlA3zYb8DT4 X-Received: by 2002:a17:902:266:: with SMTP id 93mr4330792plc.163.1573659338574; Wed, 13 Nov 2019 07:35:38 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1573659338; cv=none; d=google.com; s=arc-20160816; b=wpND1pIJRIhcfWqQ50P/8iJNLPwDPEpExr5IRekFtHKjhNlmY3+Lbb7MOVDb6xjvpG R92E9FBUk41RhRMBGapl4c0qOLlaUHaly7PyhAtuUaLSJWyMnL5bZtjsaf3pcuUYwWSf OLr5/fWxFc0MObkwaOmG5d/+8KB8AjEPpeEJrMZDKwlFXzlPUj98bKOCrgWykjZMJwD2 qaEny9fj0MMDt25FjQy8joZF40qebDru2FIP7HEGgrhLJYTU19gXUCRavYk83KBM04+2 CqzZp0QmMlDqMFw8vSnEbsM6cnqaMV6hPBSV9btYr/BNiuVL7WjYDba3gdeyvBr0tDm4 7w+w== 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=x4q+uTVhXxTRWo7o/1HLmrrP44ClK/L6mRDQJVraJpHCkwKcKMAS0Fvthy+MVAvFDi MenIawvLjWGkz82u+1rxTd4g4APnkUAfqv5301khRgp0JmRuCjOHiq3z45+8s59GsGYN gr/CUXP8hKUt6Kmcs+nkjinO7g0gU/LaywwBBaVrFwwaIhn3pdAC6x7kUc6PBmAZNIXA u9eEyTHr3w4Sofl3/TUPicA3lkGOVCsAOUH3/08VMG3GznZV6kNdfVPDDtcHxDrZkAVM TeyBklAT6F08yuq0MPGAlD/hJRG4CS70uNrVtyR34jwZWjTfACtVV64wac129KQnGlSS yE7w== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@gmail.com header.s=20161025 header.b=ac1cRpSV; 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 v4si3070808pgr.357.2019.11.13.07.35.38; Wed, 13 Nov 2019 07:35:38 -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=ac1cRpSV; 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 41D5F7F87E; Wed, 13 Nov 2019 15:32:57 +0000 (UTC) X-Original-To: openembedded-core@lists.openembedded.org Delivered-To: openembedded-core@lists.openembedded.org Received: from mail-pf1-f182.google.com (mail-pf1-f182.google.com [209.85.210.182]) by mail.openembedded.org (Postfix) with ESMTP id C33897F820 for ; Wed, 13 Nov 2019 15:32:43 +0000 (UTC) Received: by mail-pf1-f182.google.com with SMTP id p24so1902000pfn.4 for ; Wed, 13 Nov 2019 07:32:45 -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=ac1cRpSVVNz8VIj8AmYnhiYl73JbzdgrcJl+8ZdWmkKMlegUF1atxaGzK1zoE+Y31y pHVRALsTWJQujnH2AJuVTqmVnuMUBratmk8RMlIOvFg35WEGxjgFWNakVdvU6E9f3uME ZL/IH+tu5PCrIq1A2FHxGdy2klmD7BOIHyWyF2u1nb06LVA4CWsUCFSLYwo2n3PEvMnz 8mv9OHxTcZgGCtJ68SrGVBXcXrVVQYT/zUyaCmAfkdKdYbUv6WkU/4XfehOZJ7vKfZOW gN/SFsBmSTt34AUqsJWxHHM4s9XHwHW3MbBBaQfFSkLF3m090ln58aVRzjiPaoj0LAO9 v+dg== 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=YLECKk2iDu6y8lXtMvBniGQt8hePUm0bIO4ZF60mD3oSflQ2bXzt+3DjkzlhtHh7kY 1aFA9f2vIHrCF0tySpg5RsePrIleZtRiYX3ekxaak8XlCkVIFwo3ewixGtBtPVb/dPAc TPCQXzkI/It5WxXO7feHZtUOjJ6ySMrJhzEH6hWW5erUQZi5UUVnx527LeTyEwo4egis FX5R4XlZCVIgZddvbg0W1ycTpFcuwmsbhs51PKQ1RHOFpi+v6F56uYTQKSoCV1WWhEmD EcqzklIYQ2o7ou77maCNolT71UwZyM4tViYZSI54RtHpzBylbMq38fkaOm4jVKeT+S9O f98Q== X-Gm-Message-State: APjAAAX2f0eia5BHaTJLdY9PKvR6P0yH+szTzOsxkZeysIIVUqUu9/kC sR86GrgPglNdxMPEophh6VxsjE7p X-Received: by 2002:a17:90a:2942:: with SMTP id x2mr5750016pjf.119.1573659164367; Wed, 13 Nov 2019 07:32:44 -0800 (PST) Received: from akuster-ThinkPad-T460s.mvista.com ([2601:202:4180:a5c0:2cf9:53ea:e6ab:d378]) by smtp.gmail.com with ESMTPSA id s18sm3713613pfm.27.2019.11.13.07.32.43 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 13 Nov 2019 07:32:43 -0800 (PST) From: Armin Kuster To: openembedded-core@lists.openembedded.org Date: Wed, 13 Nov 2019 07:32:01 -0800 Message-Id: X-Mailer: git-send-email 2.7.4 In-Reply-To: References: Subject: [OE-core] [zeus 19/31] 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);