Blame SOURCES/nfs-utils-2.3.3-mountd-v4clnts.patch

6d6478
diff -up nfs-utils-2.3.3/support/export/v4clients.c.orig nfs-utils-2.3.3/support/export/v4clients.c
6d6478
--- nfs-utils-2.3.3/support/export/v4clients.c.orig	2022-09-26 11:36:22.803929066 -0400
6d6478
+++ nfs-utils-2.3.3/support/export/v4clients.c	2022-09-26 11:38:38.221187835 -0400
6d6478
@@ -8,6 +8,7 @@
6d6478
 #include <unistd.h>
6d6478
 #include <stdlib.h>
6d6478
 #include <sys/inotify.h>
6d6478
+#include <sys/stat.h>
6d6478
 #include <errno.h>
6d6478
 #include "export.h"
6d6478
 
6d6478
@@ -23,6 +24,12 @@ static int clients_fd = -1;
6d6478
 
6d6478
 void v4clients_init(void)
6d6478
 {
6d6478
+	struct stat sb;
6d6478
+
6d6478
+	if (!stat("/proc/fs/nfsd/clients", &sb) == 0 ||
6d6478
+		!S_ISDIR(sb.st_mode))
6d6478
+		return;
6d6478
+
6d6478
 	if (clients_fd >= 0)
6d6478
 		return;
6d6478
 	clients_fd = inotify_init1(IN_NONBLOCK);