summaryrefslogtreecommitdiffstats
path: root/utils/statd/monitor.c
diff options
context:
space:
mode:
authorSteve Dickson <steved@redhat.com>2009-03-23 17:13:01 -0400
committerSteve Dickson <steved@redhat.com>2009-03-23 17:13:01 -0400
commit3724317e223d46908aac2405bbd73ea2de4f36e5 (patch)
tree4498459f0dd3f88349c5126792f3715200397eed /utils/statd/monitor.c
parentd62365079f711b25e73522b2af380abc2a7e2788 (diff)
downloadnfs-utils-3724317e223d46908aac2405bbd73ea2de4f36e5.tar.gz
nfs-utils-3724317e223d46908aac2405bbd73ea2de4f36e5.tar.xz
nfs-utils-3724317e223d46908aac2405bbd73ea2de4f36e5.zip
In recent Fedora builds, the '-D _FORTIFY_SOURCE=2' compile
flag has been set. This cause warnings to be generated when return values from reads/writes (and other calls) are not checked. The patch address those warnings. Signed-off-by: Steve Dickson <steved@redhat.com>
Diffstat (limited to 'utils/statd/monitor.c')
-rw-r--r--utils/statd/monitor.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/utils/statd/monitor.c b/utils/statd/monitor.c
index 169cd78..a2c9e2b 100644
--- a/utils/statd/monitor.c
+++ b/utils/statd/monitor.c
@@ -204,7 +204,10 @@ sm_mon_1_svc(struct mon *argp, struct svc_req *rqstp)
e += sprintf(e, "%02x", 0xff & (argp->priv[i]));
if (e+1-buf != LINELEN) abort();
e += sprintf(e, " %s %s\n", mon_name, my_name);
- write(fd, buf, e-buf);
+ if (write(fd, buf, e-buf) != (e-buf)) {
+ note(N_WARNING, "writing to %s failed: errno %d (%s)",
+ path, errno, strerror(errno));
+ }
}
free(path);