From patchwork Wed Feb 24 12:53:22 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Harmandeep Kaur X-Patchwork-Id: 8405931 Return-Path: X-Original-To: patchwork-xen-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 64420C0553 for ; Wed, 24 Feb 2016 12:56:49 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 9120720165 for ; Wed, 24 Feb 2016 12:56:47 +0000 (UTC) Received: from lists.xen.org (lists.xenproject.org [50.57.142.19]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id B588B2011D for ; Wed, 24 Feb 2016 12:56:46 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=lists.xen.org) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1aYYxX-00085F-US; Wed, 24 Feb 2016 12:54:27 +0000 Received: from mail6.bemta3.messagelabs.com ([195.245.230.39]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1aYYxW-000848-D6 for xen-devel@lists.xenproject.org; Wed, 24 Feb 2016 12:54:26 +0000 Received: from [85.158.137.68] by server-13.bemta-3.messagelabs.com id 22/54-03443-108ADC65; Wed, 24 Feb 2016 12:54:25 +0000 X-Env-Sender: write.harmandeep@gmail.com X-Msg-Ref: server-13.tower-31.messagelabs.com!1456318463!24173841!1 X-Originating-IP: [209.85.192.194] X-SpamReason: No, hits=0.0 required=7.0 tests= X-StarScan-Received: X-StarScan-Version: 7.35.1; banners=-,-,- X-VirusChecked: Checked Received: (qmail 28111 invoked from network); 24 Feb 2016 12:54:24 -0000 Received: from mail-pf0-f194.google.com (HELO mail-pf0-f194.google.com) (209.85.192.194) by server-13.tower-31.messagelabs.com with AES128-GCM-SHA256 encrypted SMTP; 24 Feb 2016 12:54:24 -0000 Received: by mail-pf0-f194.google.com with SMTP id w128so910942pfb.2 for ; Wed, 24 Feb 2016 04:54:24 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=agRy8UnzdtAMkQu8T2cgfj00x4OkloeBjn8CqrMOjsY=; b=dkZ9bii61Op6q7PZZxk0fOo//kqbU2byEcF90gMu/XStwZ2p+PoA14kgkvyKB6F5eC AinOSJayTY1TvJJZEqp94z1EtXnCZOQUEgJLnT29J0xab/Ye3sqkmmgSqs7XRLCKo+iC h+dmKfYyhZ07rKtl3HjajHW9TyId6mD+2XxgvudxpwI5qxIpeKpxLM1JR5zbawZNw5Ad qVq/NodwihfXJMkq4sR+w3ERJFotHp+nJo1MJH60MRUbV+3/ARj3mvKyiJUWWoQdmvNi OhjI00YJZOUfZESjAGXAunFGKGwGxhNo0ufElF106BAoOqt6EDRTwmMh3mPqKFeEoPS8 L5Lg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=agRy8UnzdtAMkQu8T2cgfj00x4OkloeBjn8CqrMOjsY=; b=Zrh7nV0s1b3AVmxpOUqjavDn3xzA5JjJFi+cgFoWG+joKI6YlbsixEAroeGnqBL4X2 MeRzXoHD1rzqRiG5FDtEulh0h5lCgr+kZSdaayw8kZvoeYdrus+PL1nTMx3fmWqHtQPO GGoMpgpETMIxxO6DOvn4Tey7Zu9l257V0FrE+HDsM8mkij56nTRdufJmV13YFm7/7Cxn 7YnuZwIZBGJ3umbZZc/JE2K3y/DraM9Je9aQ9uSt2ymgfUJ5sN5xc6Tcv+1yIS5Fql8m TgLuYDhkNxnugYrcDWiYVGruCembmL13UTYWdGohujisDdFotqAYxutBT6YUVvPD01Pg zyOA== X-Gm-Message-State: AG10YOTRjFrEVzB71WwI4yCUF8HLQIqblFWPIRXQMJXK71w8Y3xdzStyPMGJolSw5NQXGQ== X-Received: by 10.98.79.9 with SMTP id d9mr54024120pfb.46.1456318462859; Wed, 24 Feb 2016 04:54:22 -0800 (PST) Received: from localhost.localdomain ([124.253.62.0]) by smtp.googlemail.com with ESMTPSA id t87sm5027294pfa.14.2016.02.24.04.54.19 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 24 Feb 2016 04:54:22 -0800 (PST) From: Harmandeep Kaur To: xen-devel@lists.xenproject.org Date: Wed, 24 Feb 2016 18:23:22 +0530 Message-Id: <1456318407-3635-5-git-send-email-write.harmandeep@gmail.com> X-Mailer: git-send-email 2.5.0 In-Reply-To: <1456318407-3635-1-git-send-email-write.harmandeep@gmail.com> References: <1456318407-3635-1-git-send-email-write.harmandeep@gmail.com> Cc: wei.liu2@citrix.com, ian.campbell@citrix.com, stefano.stabellini@eu.citrix.com, dario.faggioli@citrix.com, ian.jackson@eu.citrix.com, Harmandeep Kaur Subject: [Xen-devel] [PATCH 4/9] xl: Improve return and exit codes of main_console(), main_vncviewer() and main_dump_core(). X-BeenThere: xen-devel@lists.xen.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org X-Spam-Status: No, score=-4.1 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_MED, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Signed-off-by: Harmandeep Kaur --- tools/libxl/xl_cmdimpl.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/tools/libxl/xl_cmdimpl.c b/tools/libxl/xl_cmdimpl.c index 2092c80..e1b4286 100644 --- a/tools/libxl/xl_cmdimpl.c +++ b/tools/libxl/xl_cmdimpl.c @@ -3421,7 +3421,7 @@ int main_console(int argc, char **argv) type = LIBXL_CONSOLE_TYPE_SERIAL; else { fprintf(stderr, "console type supported are: pv, serial\n"); - return 2; + return EXIT_FAILURE; } break; case 'n': @@ -3435,7 +3435,7 @@ int main_console(int argc, char **argv) else libxl_console_exec(ctx, domid, num, type); fprintf(stderr, "Unable to attach console\n"); - return 1; + return EXIT_FAILURE; } int main_vncviewer(int argc, char **argv) @@ -3457,8 +3457,8 @@ int main_vncviewer(int argc, char **argv) domid = find_domain(argv[optind]); if (vncviewer(domid, autopass)) - return 1; - return 0; + return EXIT_FAILURE; + return EXIT_SUCCESS; } static void pcilist(uint32_t domid) @@ -4013,7 +4013,7 @@ static void core_dump_domain(uint32_t domid, const char *filename) int rc; rc=libxl_domain_core_dump(ctx, domid, filename, NULL); - if (rc) { fprintf(stderr,"core dump failed (rc=%d)\n",rc);exit(-1); } + if (rc) { fprintf(stderr,"core dump failed (rc=%d)\n",rc);exit(EXIT_FAILURE); } } #ifndef LIBXL_HAVE_NO_SUSPEND_RESUME @@ -4774,7 +4774,7 @@ int main_dump_core(int argc, char **argv) } core_dump_domain(find_domain(argv[optind]), argv[optind + 1]); - return 0; + return EXIT_SUCCESS; } int main_pause(int argc, char **argv)