From patchwork Wed Oct 25 13:41:49 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hal Rosenstock X-Patchwork-Id: 10026737 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id BEB5D601E8 for ; Wed, 25 Oct 2017 13:41:52 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id AE21827B2F for ; Wed, 25 Oct 2017 13:41:52 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id A304928999; Wed, 25 Oct 2017 13:41:52 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.3 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI, RCVD_IN_SORBS_SPAM, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 34DEE27B2F for ; Wed, 25 Oct 2017 13:41:52 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751421AbdJYNlv (ORCPT ); Wed, 25 Oct 2017 09:41:51 -0400 Received: from mail-qk0-f195.google.com ([209.85.220.195]:48879 "EHLO mail-qk0-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751289AbdJYNlu (ORCPT ); Wed, 25 Oct 2017 09:41:50 -0400 Received: by mail-qk0-f195.google.com with SMTP id d67so31264qkg.5 for ; Wed, 25 Oct 2017 06:41:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=dev-mellanox-co-il.20150623.gappssmtp.com; s=20150623; h=to:cc:from:subject:message-id:date:user-agent:mime-version :content-language:content-transfer-encoding; bh=fAbpL+pYbB0DbDwv0CM+EJnCc71XSHJ/eesKqAYFu5M=; b=r3UMQxBizLiVuYJYH7IY+L7p85U3OwqSk9iJdHQueCpFJKMj+DMbfgHr7+yBEJ7JRG BCb7QHapDLuCxE5yqNLGdMtI5g8E1DIKvJrGpf/yqIkr8J7rYEP3nki+p18ABPb4lAkC OaIVkmaOHyHTIhuLlIoYWq6M18esSd1GVnld5IJOvMSlhKHYNgmk5XqxI5rAaF+tW1AE 4m+rGx9twRvibp2O7pwrad0P3hhsfYiAJN+9KNNYsbKgifGBSheykrOq9wDegsaXomul T1SHtApfQISiEyHogss3V1/JZf8VqIukTCyMzbSEwczDwgCxOciaqKkLb0eEs4V4ThLc T9RA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:to:cc:from:subject:message-id:date:user-agent :mime-version:content-language:content-transfer-encoding; bh=fAbpL+pYbB0DbDwv0CM+EJnCc71XSHJ/eesKqAYFu5M=; b=NggDYWcJ7SRzb1E9TBwzOJwAoAtuQjd6byQsoPIYbZZdPSG+7pHekD9uFpk6U0iQYJ wMi7pmx637AmtXfki2lvqL0N3i4TtPblY5WYWg2BKZUfoVQdiI7hLLPvm21cQPnVe/Mj f3Go6V0iGB7iNVzQ2UVdsMDugXsub2EmDBN0nPI6AHMYyIJjp6vf4BQOf648T4Yti+2D WaMLYfElMEyHMrqh6GPykOhqYH8zTb5+FdKsWA5DbvkHL+9OZfuCZ8l+WFrMVNeImgFV zrX3laiWzPltEmTPe6oF57K/HU6NY7ZtzZyQRUgXQp+0jGJ0Ztt3CSfd9IYoZSrqH6lA BNLQ== X-Gm-Message-State: AMCzsaWoMaKV6IsZEa1ZeejtsHEQqNePgl3c5NbQxYqfuHvEdN1zbYyC S2oDx5spcvP+j06Uvfe6/lj1fVHz X-Google-Smtp-Source: ABhQp+TaB8MIj52isWPklALE9kybzYNUWHnL3S82ODQFB5Vlc5x+Vve/6JhN+X1i4n/oizdFOcg2qw== X-Received: by 10.55.130.5 with SMTP id e5mr2886784qkd.155.1508938910066; Wed, 25 Oct 2017 06:41:50 -0700 (PDT) Received: from [192.168.1.183] (c-73-182-207-166.hsd1.ma.comcast.net. [73.182.207.166]) by smtp.googlemail.com with ESMTPSA id s9sm2025922qts.42.2017.10.25.06.41.49 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 25 Oct 2017 06:41:49 -0700 (PDT) To: "Hefty, Sean" Cc: "linux-rdma@vger.kernel.org" From: Hal Rosenstock Subject: [PATCH rdma-core 1/3] ibacm: acm_util.c: Better log message when ioctl fails in acm_if_iter_sys Message-ID: <6dc90dcf-d6df-dffd-5c07-728ebdae249f@dev.mellanox.co.il> Date: Wed, 25 Oct 2017 09:41:49 -0400 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.4.0 MIME-Version: 1.0 Content-Language: en-US Sender: linux-rdma-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP RETURN VALUE for ioctl says: On error, -1 is returned, and errno is set appropriately. Rather than log the return value, use the string for errno. Signed-off-by: Hal Rosenstock --- ibacm/src/acm_util.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ibacm/src/acm_util.c b/ibacm/src/acm_util.c index aca042d..b50fd74 100644 --- a/ibacm/src/acm_util.c +++ b/ibacm/src/acm_util.c @@ -152,7 +152,7 @@ int acm_if_iter_sys(acm_if_iter_cb cb, void *ctx) ret = ioctl(s, SIOCGIFCONF, ifc); if (ret < 0) { - acm_log(0, "ioctl ifconf error %d\n", ret); + acm_log(0, "ioctl ifconf error: %s\n", strerror(errno)); goto out2; }