From patchwork Tue May 3 10:55:06 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Roger_Pau_Monn=C3=A9?= X-Patchwork-Id: 9002741 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 3C495BF29F for ; Tue, 3 May 2016 10:57:23 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 6B5AF20225 for ; Tue, 3 May 2016 10:57:22 +0000 (UTC) Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 7286620219 for ; Tue, 3 May 2016 10:57:21 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1axXz9-0000Uy-Tz; Tue, 03 May 2016 10:55:23 +0000 Received: from mail6.bemta5.messagelabs.com ([195.245.231.135]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1axXz9-0000UL-4H for xen-devel@lists.xenproject.org; Tue, 03 May 2016 10:55:23 +0000 Received: from [85.158.139.211] by server-6.bemta-5.messagelabs.com id F9/D2-00612-A9388275; Tue, 03 May 2016 10:55:22 +0000 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFlrCIsWRWlGSWpSXmKPExsXitHRDpO7MZo1 wg8WzzS2+b5nM5MDocfjDFZYAxijWzLyk/IoE1oyvn48yF8zhrji50rmB8QBHFyMnh4SAv0T/ o8NMIDabgI7Exbk72boYOThEBFQkbu816GLk4mAWuMQosXHSNVaQGmEBJ4kP63sZQWpYgGp+3 UoGCfMKuEhcPHGSEWKkrsTJ3ZvYQUo4BVwlGu8ZgISFgEpmTuhlgygXlDg58wkLiM0soCnRuv 03O4QtL9G8dTYzRL2iRP+8B2DXSAhwS/zttp/AyD8LSfcsJN2zkHQvYGRexahenFpUllqka6y XVJSZnlGSm5iZo2toYKqXm1pcnJiempOYVKyXnJ+7iREYegxAsINx7z+nQ4ySHExKorwSd9XD hfiS8lMqMxKLM+KLSnNSiw8xynBwKEnwVjdphAsJFqWmp1akZeYAowAmLcHBoyTC2wyS5i0uS MwtzkyHSJ1iVJQS560HSQiAJDJK8+DaYJF3iVFWSpiXEegQIZ6C1KLczBJU+VeM4hyMSsK8J0 Gm8GTmlcBNfwW0mAlocfZ6VZDFJYkIKakGxsC+nZHMlhM2FO/1nTHdc13nnvMPfz+1CUzLjJr fI86bzdCzd+GsjKU7jn4vW/IzKeer4tmpvX2LZgiu3Z6UdO7Aej2Z9hv6269su7f+5nnmn8HV 9xb56udtEb0jXbKMgyk3WOxsn6npv2kTpRMdWtMuOzxsuzvr/peAHbs5Xy06UbPH28LgAasSS 3FGoqEWc1FxIgC0sJmbtwIAAA== X-Env-Sender: prvs=924d4b44a=roger.pau@citrix.com X-Msg-Ref: server-13.tower-206.messagelabs.com!1462272918!33733871!2 X-Originating-IP: [66.165.176.89] X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni44OSA9PiAyMDMwMDc=\n, received_headers: No Received headers X-StarScan-Received: X-StarScan-Version: 8.34; banners=-,-,- X-VirusChecked: Checked Received: (qmail 63614 invoked from network); 3 May 2016 10:55:21 -0000 Received: from smtp.citrix.com (HELO SMTP.CITRIX.COM) (66.165.176.89) by server-13.tower-206.messagelabs.com with RC4-SHA encrypted SMTP; 3 May 2016 10:55:21 -0000 X-IronPort-AV: E=Sophos;i="5.24,572,1454976000"; d="scan'208";a="351336723" From: Roger Pau Monne To: Date: Tue, 3 May 2016 12:55:06 +0200 Message-ID: <1462272910-41200-3-git-send-email-roger.pau@citrix.com> X-Mailer: git-send-email 2.6.4 (Apple Git-63) In-Reply-To: <1462272910-41200-1-git-send-email-roger.pau@citrix.com> References: <1462272910-41200-1-git-send-email-roger.pau@citrix.com> MIME-Version: 1.0 X-DLP: MIA1 Cc: Ross Lagerwall , Ian Jackson , Wei Liu , Roger Pau Monne Subject: [Xen-devel] [PATCH v2 for-4.7 2/6] tools/xsplice: corrently use errno X-BeenThere: xen-devel@lists.xen.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xen.org Sender: "Xen-devel" X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, 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 Some error paths incorrectly used rc instead of errno. Signed-off-by: Roger Pau Monné Acked-by: Wei Liu --- Cc: Konrad Rzeszutek Wilk Cc: Ross Lagerwall Cc: Ian Jackson Cc: Wei Liu --- Changes since v1: - Fix error message. --- tools/misc/xen-xsplice.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/tools/misc/xen-xsplice.c b/tools/misc/xen-xsplice.c index 0f1ab5a..598e492 100644 --- a/tools/misc/xen-xsplice.c +++ b/tools/misc/xen-xsplice.c @@ -272,8 +272,8 @@ int action_func(int argc, char *argv[], unsigned int idx) rc = xc_xsplice_get(xch, name, &status); if ( rc ) { - fprintf(stderr, "%s failed to get status (rc=%d, %s)!\n", - name, -rc, strerror(-rc)); + fprintf(stderr, "%s failed to get status %d(%s)!\n", + name, errno, strerror(errno)); return -1; } if ( status.rc == -EAGAIN ) @@ -295,7 +295,8 @@ int action_func(int argc, char *argv[], unsigned int idx) rc = action_options[idx].function(xch, name, 0); if ( rc ) { - fprintf(stderr, "%s failed with %d(%s)\n", name, -rc, strerror(-rc)); + fprintf(stderr, "%s failed with %d(%s)\n", name, errno, + strerror(errno)); return -1; } }