]> git.decadent.org.uk Git - nfs-utils.git/commitdiff
exportfs: do not warn if /etc/exports.d/ does not exist
authorMike Frysinger <vapier@gentoo.org>
Thu, 1 Sep 2011 15:34:25 +0000 (11:34 -0400)
committerSteve Dickson <steved@redhat.com>
Thu, 1 Sep 2011 15:34:25 +0000 (11:34 -0400)
It isn't uncommon for /etc/exports.d/ to not exist, and imo, it's not
that big of a deal as often times, a simple /etc/exports is sufficient.
So silently skip the case where the dir is missing.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
Signed-off-by: Steve Dickson <steved@redhat.com>
utils/exportfs/exportfs.c

index 986a272fd7e69924155086e83f5bf577706ca610..7432a6592c8d0e69c60dfc69ececec56e92b1f34 100644 (file)
@@ -529,9 +529,12 @@ export_d_read(const char *dname)
 
 
        n = scandir(dname, &namelist, NULL, versionsort);
-       if (n < 0)
+       if (n < 0) {
+               if (errno == ENOENT)
+                       /* Silently return */
+                       return;
                xlog(L_NOTICE, "scandir %s: %s", dname, strerror(errno));
-       else if (n == 0)
+       else if (n == 0)
                return;
 
        for (i = 0; i < n; i++) {