From 3724317e223d46908aac2405bbd73ea2de4f36e5 Mon Sep 17 00:00:00 2001 From: Steve Dickson Date: Mon, 23 Mar 2009 17:13:01 -0400 Subject: 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 --- utils/idmapd/idmapd.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'utils/idmapd') diff --git a/utils/idmapd/idmapd.c b/utils/idmapd/idmapd.c index c1cf4eb..b690e21 100644 --- a/utils/idmapd/idmapd.c +++ b/utils/idmapd/idmapd.c @@ -169,7 +169,10 @@ flush_nfsd_cache(char *path, time_t now) fd = open(path, O_RDWR); if (fd == -1) return -1; - write(fd, stime, strlen(stime)); + if (write(fd, stime, strlen(stime)) != strlen(stime)) { + errx(1, "Flushing nfsd cache failed: errno %d (%s)", + errno, strerror(errno)); + } close(fd); return 0; } @@ -988,7 +991,10 @@ release_parent(void) int status; if (pipefds[1] > 0) { - write(pipefds[1], &status, 1); + if (write(pipefds[1], &status, 1) != 1) { + err(1, "Writing to parent pipe failed: errno %d (%s)\n", + errno, strerror(errno)); + } close(pipefds[1]); pipefds[1] = -1; } -- cgit