+static void
+nfsdreopen_one(struct idmap_client *ic)
+{
+ int fd;
+
+ if (verbose > 0)
+ warnx("ReOpening %s", ic->ic_path);
+ if ((fd = open(ic->ic_path, O_RDWR, 0)) != -1) {
+ if (ic->ic_fd != -1)
+ close(ic->ic_fd);
+ ic->ic_event.ev_fd = ic->ic_fd = fd;
+ if ((ic->ic_event.ev_flags & EVLIST_INIT) == 0) {
+ event_set(&ic->ic_event, ic->ic_fd, EV_READ, nfsdcb, ic);
+ event_add(&ic->ic_event, NULL);
+ }
+ } else {
+ warnx("nfsdreopen: Opening '%s' failed: errno %d (%s)",
+ ic->ic_path, errno, strerror(errno));
+ }
+}
+
+/*
+ * Note: nfsdreopen assumes nfsdopen has already been called
+ */
+static void
+nfsdreopen()
+{
+ nfsdreopen_one(&nfsd_ic[IC_NAMEID]);
+ nfsdreopen_one(&nfsd_ic[IC_IDNAME]);
+ return;
+}
+