@@ -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;
@@ -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));
}
/*
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(-)