All of lore.kernel.org
 help / color / mirror / Atom feed
From: Steve Dickson <steved@redhat.com>
To: Linux NFS Mailing list <linux-nfs@vger.kernel.org>
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	[thread overview]
Message-ID: <20180604145051.146390-3-steved@redhat.com> (raw)
In-Reply-To: <20180604145051.146390-1-steved@redhat.com>

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 <steved@redhat.com>
---
 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));
 }
 
 /*
-- 
1.8.3.1


  parent reply	other threads:[~2018-06-04 14:50 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-06-04 14:50 [PATCH 0/4] Removed more warnings that now errors via -W Steve Dickson
2018-06-04 14:50 ` [PATCH 1/4] xtab.c: Removed overflow in implicit constant conversion errors Steve Dickson
2018-06-04 15:03   ` Chuck Lever
2018-06-04 14:50 ` Steve Dickson [this message]
2018-06-04 14:50 ` [PATCH 3/4] Removed format expects argument of type errors Steve Dickson
2018-06-04 14:50 ` [PATCH 4/4] gssd.c: Remomved a couple of warning errors Steve Dickson
2018-06-05 17:21 ` [PATCH 0/4] Removed more warnings that now errors via -W Steve Dickson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180604145051.146390-3-steved@redhat.com \
    --to=steved@redhat.com \
    --cc=linux-nfs@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.