X-Git-Url: https://git.decadent.org.uk/gitweb/?p=nfs-utils.git;a=blobdiff_plain;f=utils%2Fidmapd%2Fidmapd.c;h=b690e21fae9697a4e9ec6d0dc5221759576cacb3;hp=6b5971cad526aa86e472937f8af9492fb323fb45;hb=3724317e223d46908aac2405bbd73ea2de4f36e5;hpb=bcd0fcaf0966c546da5043be700587f73174ae25 diff --git a/utils/idmapd/idmapd.c b/utils/idmapd/idmapd.c index 6b5971c..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; } @@ -342,9 +345,11 @@ main(int argc, char **argv) xlog_err("main: fcntl(%s): %s", pipefsdir, strerror(errno)); if (fcntl(fd, F_NOTIFY, - DN_CREATE | DN_DELETE | DN_MODIFY | DN_MULTISHOT) == -1) + DN_CREATE | DN_DELETE | DN_MODIFY | DN_MULTISHOT) == -1) { xlog_err("main: fcntl(%s): %s", pipefsdir, strerror(errno)); - + if (errno == EINVAL) + xlog_err("main: Possibly no Dnotify support in kernel."); + } TAILQ_INIT(&icq); /* These events are persistent */ @@ -986,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; }