From patchwork Fri Oct 2 13:00:53 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Riku Voipio X-Patchwork-Id: 54437 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-lb0-f199.google.com (mail-lb0-f199.google.com [209.85.217.199]) by patches.linaro.org (Postfix) with ESMTPS id B6AF023009 for ; Fri, 2 Oct 2015 13:51:05 +0000 (UTC) Received: by lbcao8 with SMTP id ao8sf16786577lbc.1 for ; Fri, 02 Oct 2015 06:51:04 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:delivered-to:from:to:date :message-id:in-reply-to:references:cc:subject:precedence:list-id :list-unsubscribe:list-archive:list-post:list-help:list-subscribe :errors-to:sender:x-original-sender :x-original-authentication-results:mailing-list; bh=BKvEurdxHcor7sfRbksrVjmTyqtFDSqVZDMHNQmgjmc=; b=FtSGeUaM84vqNu1wUlE6/pO0s5e4S6Gpd9pyhw5EV/5ykeJtVIr6hQC6SsIo/0OtpI vbsnz/9JvPyhxxXfIG4bfKTYVrOPqHtqWeP/tBSJHO4cbRsiGZ3HHdtzExNofx2R7OqZ WCYJ2vAaJenBn6Tw73gWRqjZfkNtpnDTIIlg3KnbldA7w9NBQ37UXhuI5cZgb+0prskB wTArmtI7kRvSgJO3wjp2VzysCHPHplt5vlOAwNIXQrXiCxJDS5pk/5is29yVB3MFaF1W ppV2HGOSKPblTX/fJZlQnYXcZTSYEcGpaSrjvxcjbnQqGft8tqMJnY2D+CEhAmHu5D8D MvuA== X-Gm-Message-State: ALoCoQkMeh0qE7oc7S/JlDDhpXlyyIhE21+9a1XBikTpBaADYecnqmfY9/ytBSmMn2EiSWMLgOZL X-Received: by 10.112.130.41 with SMTP id ob9mr2588640lbb.17.1443793864703; Fri, 02 Oct 2015 06:51:04 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.25.44.12 with SMTP id s12ls19081lfs.90.gmail; Fri, 02 Oct 2015 06:51:04 -0700 (PDT) X-Received: by 10.112.159.168 with SMTP id xd8mr5563905lbb.118.1443793864559; Fri, 02 Oct 2015 06:51:04 -0700 (PDT) Received: from mail-la0-f54.google.com (mail-la0-f54.google.com. [209.85.215.54]) by mx.google.com with ESMTPS id i8si6289708lbj.130.2015.10.02.06.51.04 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 02 Oct 2015 06:51:04 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.54 as permitted sender) client-ip=209.85.215.54; Received: by laer8 with SMTP id r8so92750726lae.2 for ; Fri, 02 Oct 2015 06:51:04 -0700 (PDT) X-Received: by 10.112.199.137 with SMTP id jk9mr5787997lbc.86.1443793864420; Fri, 02 Oct 2015 06:51:04 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.112.59.35 with SMTP id w3csp1258420lbq; Fri, 2 Oct 2015 06:51:02 -0700 (PDT) X-Received: by 10.55.41.165 with SMTP id p37mr2204990qkp.73.1443793862381; Fri, 02 Oct 2015 06:51:02 -0700 (PDT) Received: from lists.gnu.org (lists.gnu.org. [2001:4830:134:3::11]) by mx.google.com with ESMTPS id l6si10358162qkh.74.2015.10.02.06.51.02 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Fri, 02 Oct 2015 06:51:02 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) client-ip=2001:4830:134:3::11; Received: from localhost ([::1]:59964 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Zi0jl-0003IK-SZ for patch@linaro.org; Fri, 02 Oct 2015 09:51:01 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:37226) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Zhzxb-0005BT-0t for qemu-devel@nongnu.org; Fri, 02 Oct 2015 09:01:19 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZhzxW-0000Yi-PO for qemu-devel@nongnu.org; Fri, 02 Oct 2015 09:01:14 -0400 Received: from mail-lb0-f176.google.com ([209.85.217.176]:33861) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZhzxW-0000Ye-IA for qemu-devel@nongnu.org; Fri, 02 Oct 2015 09:01:10 -0400 Received: by lbbmp1 with SMTP id mp1so26046932lbb.1 for ; Fri, 02 Oct 2015 06:01:09 -0700 (PDT) X-Received: by 10.25.39.76 with SMTP id n73mr3520128lfn.60.1443790869686; Fri, 02 Oct 2015 06:01:09 -0700 (PDT) Received: from localhost.localdomain (91-157-196-38.elisa-laajakaista.fi. [91.157.196.38]) by smtp.gmail.com with ESMTPSA id w143sm1514751lfd.2.2015.10.02.06.01.08 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 02 Oct 2015 06:01:08 -0700 (PDT) From: riku.voipio@linaro.org To: qemu-devel@nongnu.org Date: Fri, 2 Oct 2015 16:00:53 +0300 Message-Id: X-Mailer: git-send-email 2.5.3 In-Reply-To: References: X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.85.217.176 Cc: Meador Inge Subject: [Qemu-devel] [PULL 01/13] linux-user: Exit 0 when -h is used X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: , List-Help: , List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: riku.voipio@linaro.org X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.54 as permitted sender) smtp.mailfrom=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 From: Meador Inge Signed-off-by: Meador Inge Signed-off-by: Riku Voipio --- linux-user/main.c | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/linux-user/main.c b/linux-user/main.c index 25cf875..7593212 100644 --- a/linux-user/main.c +++ b/linux-user/main.c @@ -63,7 +63,7 @@ unsigned long reserved_va = 0xf7000000; unsigned long reserved_va; #endif -static void usage(void); +static void usage(int exitcode); static const char *interp_prefix = CONFIG_QEMU_INTERP_PREFIX; const char *qemu_uname_release; @@ -3700,7 +3700,7 @@ CPUArchState *cpu_copy(CPUArchState *env) static void handle_arg_help(const char *arg) { - usage(); + usage(0); } static void handle_arg_log(const char *arg) @@ -3726,7 +3726,7 @@ static void handle_arg_set_env(const char *arg) r = p = strdup(arg); while ((token = strsep(&p, ",")) != NULL) { if (envlist_setenv(envlist, token) != 0) { - usage(); + usage(1); } } free(r); @@ -3738,7 +3738,7 @@ static void handle_arg_unset_env(const char *arg) r = p = strdup(arg); while ((token = strsep(&p, ",")) != NULL) { if (envlist_unsetenv(envlist, token) != 0) { - usage(); + usage(1); } } free(r); @@ -3754,7 +3754,7 @@ static void handle_arg_stack_size(const char *arg) char *p; guest_stack_size = strtoul(arg, &p, 0); if (guest_stack_size == 0) { - usage(); + usage(1); } if (*p == 'M') { @@ -3921,7 +3921,7 @@ static const struct qemu_argument arg_table[] = { {NULL, NULL, false, NULL, NULL, NULL} }; -static void usage(void) +static void usage(int exitcode) { const struct qemu_argument *arginfo; int maxarglen; @@ -3988,7 +3988,7 @@ static void usage(void) "Note that if you provide several changes to a single variable\n" "the last change will stay in effect.\n"); - exit(1); + exit(exitcode); } static int parse_args(int argc, char **argv) @@ -4027,7 +4027,7 @@ static int parse_args(int argc, char **argv) if (!strcmp(r, arginfo->argv)) { if (arginfo->has_arg) { if (optind >= argc) { - usage(); + usage(1); } arginfo->handle_opt(argv[optind]); optind++; @@ -4040,12 +4040,12 @@ static int parse_args(int argc, char **argv) /* no option matched the current argv */ if (arginfo->handle_opt == NULL) { - usage(); + usage(1); } } if (optind >= argc) { - usage(); + usage(1); } filename = argv[optind];