X-Git-Url: https://git.decadent.org.uk/gitweb/?p=nfs-utils.git;a=blobdiff_plain;f=utils%2Fidmapd%2Fidmapd.c;h=9cbe96c4095a46d81d2847521f9838d81c043993;hp=c1cf4eb40e09471a5ff3c58141b2bb276c3881c5;hb=1aa4121ba599de836702d7b2d38cad63e6a09044;hpb=35001db4aaafa8a17e13b8c13cf74508d4a93f2f diff --git a/utils/idmapd/idmapd.c b/utils/idmapd/idmapd.c index c1cf4eb..9cbe96c 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; } @@ -975,9 +978,12 @@ mydaemon(int nochdir, int noclose) dup2(tempfd, 0); dup2(tempfd, 1); dup2(tempfd, 2); - closeall(3); - } else - closeall(0); + close(tempfd); + } else { + err(1, "mydaemon: can't open /dev/null: errno %d", + errno); + exit(1); + } } return; @@ -988,7 +994,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; }