From patchwork Wed Feb 24 12:53:27 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Harmandeep Kaur X-Patchwork-Id: 8405981 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 9D57AC0553 for ; Wed, 24 Feb 2016 12:57:03 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id C88A620165 for ; Wed, 24 Feb 2016 12:57:02 +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 DC3F92011D for ; Wed, 24 Feb 2016 12:57:01 +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 1aYYxp-0008KU-EJ; Wed, 24 Feb 2016 12:54:45 +0000 Received: from mail6.bemta3.messagelabs.com ([195.245.230.39]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1aYYxo-0008Ji-PV for xen-devel@lists.xenproject.org; Wed, 24 Feb 2016 12:54:44 +0000 Received: from [85.158.137.68] by server-12.bemta-3.messagelabs.com id D1/70-19343-418ADC65; Wed, 24 Feb 2016 12:54:44 +0000 X-Env-Sender: write.harmandeep@gmail.com X-Msg-Ref: server-6.tower-31.messagelabs.com!1456318481!24710581!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 13314 invoked from network); 24 Feb 2016 12:54:42 -0000 Received: from mail-pf0-f194.google.com (HELO mail-pf0-f194.google.com) (209.85.192.194) by server-6.tower-31.messagelabs.com with AES128-GCM-SHA256 encrypted SMTP; 24 Feb 2016 12:54:42 -0000 Received: by mail-pf0-f194.google.com with SMTP id c10so918584pfc.0 for ; Wed, 24 Feb 2016 04:54:42 -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=wxaj1ubGzrKBSNvGpXQGuk8GQ5e9VXL1iy7wM35wFP4=; b=L9k2QgIQIMClukb2+GhiM8qNCLGhAPQL1mX/dQoalnk3ZW5SE05IIVVgMKBk2LnBgt UWEPhhXqmIP3gKuLOTwH7VU7Yg2WKDtuZObipzw8+Emfsd1GP0DyNTQtgnNVYc5MSqsz 6dVqKuXNdfugwaCitC0dus84+Ctz2im//QQbmo5MD9JBYqPPjZn/CNH8Ia1L5MxADjEu fqUtstJ64sSHyCt8usKZJUwoPm8tcQIqmYcs66QDJKKGYN7XdvdqRt4gfV1U7OZIOWWw oGeZ/WiflVtCIWgIRkJq+cLihjWHmBimb0JBk9Lnn3NtocQqP4gdMzr+R/nYwaD2Vcvi gFpw== 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=wxaj1ubGzrKBSNvGpXQGuk8GQ5e9VXL1iy7wM35wFP4=; b=HhGiywUYmu7vEswHuo9AegD5Gd0kqwlHjFYULLm+0+PFOg16baMseJBwCQOYr1qI59 ViQMH9mhRsbIkmIdDO2LGy0VMqYIQKRttznnZp62qQSIDOiCqHXyj3V0qrRT8wMXSC4F h/Af7jle2T4sitnmkIST8HJSUz0IPTiVPRMv6EfeURyBWfaHiNFMQ/utJ0kAey6mSK9w oU95sVmIixj4YHFEip3n/mj+uJhVrHNTlmAd5BIGNF1DQq2yF6BjcBEV3PKZ9zqEtWtM VU/g1qZ0lXB4gcBfE6kukQGuPcYm1FWhTziTSAxUtPxiaqrY+E80Qizv+coUg8eOuXFR BpZQ== X-Gm-Message-State: AG10YOTATp3BkeMH8Eyt36FYzN2yov7TM0GBOo5RtS2N0p5G4fqZEYy8MMVYbzhBL2OMrg== X-Received: by 10.98.34.209 with SMTP id p78mr54563835pfj.154.1456318481022; Wed, 24 Feb 2016 04:54:41 -0800 (PST) Received: from localhost.localdomain ([124.253.62.0]) by smtp.googlemail.com with ESMTPSA id t87sm5027294pfa.14.2016.02.24.04.54.37 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 24 Feb 2016 04:54:40 -0800 (PST) From: Harmandeep Kaur To: xen-devel@lists.xenproject.org Date: Wed, 24 Feb 2016 18:23:27 +0530 Message-Id: <1456318407-3635-10-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 9/9] xl: Improve return codes of main_domid(), main_domname() and main_sysrq() and related functions. 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 9e0a467..234977c 100644 --- a/tools/libxl/xl_cmdimpl.c +++ b/tools/libxl/xl_cmdimpl.c @@ -6320,12 +6320,12 @@ int main_domid(int argc, char **argv) if (libxl_name_to_domid(ctx, domname, &domid)) { fprintf(stderr, "Can't get domid of domain name '%s', maybe this domain does not exist.\n", domname); - return 1; + return EXIT_FAILURE; } printf("%d\n", domid); - return 0; + return EXIT_SUCCESS; } int main_domname(int argc, char **argv) @@ -6343,13 +6343,13 @@ int main_domname(int argc, char **argv) if (domid == 0 && !strcmp(endptr, argv[optind])) { /*no digits at all*/ fprintf(stderr, "Invalid domain id.\n\n"); - return 1; + return EXIT_FAILURE; } domname = libxl_domid_to_name(ctx, domid); if (!domname) { fprintf(stderr, "Can't get domain name of domain id '%d', maybe this domain does not exist.\n", domid); - return 1; + return EXIT_SUCCESS; } printf("%s\n", domname); @@ -6431,12 +6431,12 @@ int main_sysrq(int argc, char **argv) if (sysrq[1] != '\0') { fprintf(stderr, "Invalid sysrq.\n\n"); help("sysrq"); - return 1; + return EXIT_FAILURE; } libxl_send_sysrq(ctx, domid, sysrq[0]); - return 0; + return EXIT_SUCCESS; } int main_debug_keys(int argc, char **argv)