From patchwork Mon Jun 4 14:50:49 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Steve Dickson X-Patchwork-Id: 10446753 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 38CC260284 for ; Mon, 4 Jun 2018 14:50:59 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 22D972880B for ; Mon, 4 Jun 2018 14:50:59 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 1DCEA287FB; Mon, 4 Jun 2018 14:50:59 +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=-7.9 required=2.0 tests=BAYES_00, MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI 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 347EA2886D for ; Mon, 4 Jun 2018 14:50:58 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753372AbeFDOu4 (ORCPT ); Mon, 4 Jun 2018 10:50:56 -0400 Received: from mx1.redhat.com ([209.132.183.28]:36474 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752370AbeFDOuy (ORCPT ); Mon, 4 Jun 2018 10:50:54 -0400 Received: from smtp.corp.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.26]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 019BCDF15C for ; Mon, 4 Jun 2018 14:50:53 +0000 (UTC) Received: from steved.boston.devel.redhat.com (ovpn-116-215.phx2.redhat.com [10.3.116.215]) by smtp.corp.redhat.com (Postfix) with ESMTP id 9907C3083321 for ; Mon, 4 Jun 2018 14:50:53 +0000 (UTC) From: Steve Dickson To: Linux NFS Mailing list Subject: [PATCH 2/4] Removed ISO C does not support the '%m' gnu_printf format errors Date: Mon, 4 Jun 2018 10:50:49 -0400 Message-Id: <20180604145051.146390-3-steved@redhat.com> In-Reply-To: <20180604145051.146390-1-steved@redhat.com> References: <20180604145051.146390-1-steved@redhat.com> X-Scanned-By: MIMEDefang 2.84 on 10.5.11.26 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.27]); Mon, 04 Jun 2018 14:50:54 +0000 (UTC) Sender: linux-nfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP nfsstat.c: In function 'mounts': nfsstat.c:1016:3: error: ISO C does not support the '%m' gnu_printf format [-Werror=format=] fprintf(stderr, "Warning: %s: %m\n", name); ^ nfsstat.c: In function 'get_stats': nfsstat.c:1093:6: error: ISO C does not support the '%m' gnu_printf format [-Werror=format=] label, file); statd.c: In function 'set_nlm_port': statd.c:235:5: error: ISO C does not support the '%m' gnu_printf format [-Werror=format=] name_p, type); ^ statd.c:238:3: error: ISO C does not support the '%m' gnu_printf format [-Werror=format=] fprintf(stderr, "%s: failed to open %s: %m\n", name_p, pathbuf); Signed-off-by: Steve Dickson --- utils/nfsstat/nfsstat.c | 6 +++--- utils/statd/statd.c | 7 ++++--- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/utils/nfsstat/nfsstat.c b/utils/nfsstat/nfsstat.c index c779053..8fccea7 100644 --- a/utils/nfsstat/nfsstat.c +++ b/utils/nfsstat/nfsstat.c @@ -1013,7 +1013,7 @@ mounts(const char *name) * be a fatal error -- it usually means the module isn't loaded. */ if ((fp = fopen(name, "r")) == NULL) { - fprintf(stderr, "Warning: %s: %m\n", name); + fprintf(stderr, "Warning: %s: %s\n", name, strerror(errno)); return 0; } @@ -1089,8 +1089,8 @@ out: fclose(fp); if (err) { if (!other_opt) { - fprintf(stderr, "Error: No %s Stats (%s: %m). \n", - label, file); + fprintf(stderr, "Error: No %s Stats (%s: %s). \n", + label, file, strerror(errno)); exit(2); } *opt = 0; diff --git a/utils/statd/statd.c b/utils/statd/statd.c index 563a272..2cc6cf3 100644 --- a/utils/statd/statd.c +++ b/utils/statd/statd.c @@ -231,11 +231,12 @@ static void set_nlm_port(char *type, int port) } if (fd >= 0) { if (write(fd, nbuf, strlen(nbuf)) != (ssize_t)strlen(nbuf)) - fprintf(stderr, "%s: fail to set NLM %s port: %m\n", - name_p, type); + fprintf(stderr, "%s: fail to set NLM %s port: %s\n", + name_p, type, strerror(errno)); close(fd); } else - fprintf(stderr, "%s: failed to open %s: %m\n", name_p, pathbuf); + fprintf(stderr, "%s: failed to open %s: %s\n", + name_p, pathbuf, strerror(errno)); } /*