]> git.decadent.org.uk Git - nfs-utils.git/blobdiff - utils/idmapd/idmapd.c
In recent Fedora builds, the '-D _FORTIFY_SOURCE=2' compile
[nfs-utils.git] / utils / idmapd / idmapd.c
index c1cf4eb40e09471a5ff3c58141b2bb276c3881c5..b690e21fae9697a4e9ec6d0dc5221759576cacb3 100644 (file)
@@ -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;
        }