From: Mike Frysinger Date: Thu, 1 Sep 2011 15:34:25 +0000 (-0400) Subject: exportfs: do not warn if /etc/exports.d/ does not exist X-Git-Tag: debian/1%1.2.5-1~11^2~19 X-Git-Url: https://git.decadent.org.uk/gitweb/?a=commitdiff_plain;h=ba306bf247be1db85e871de1add8781f7f458b69;p=nfs-utils.git exportfs: do not warn if /etc/exports.d/ does not exist 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 Signed-off-by: Steve Dickson --- diff --git a/utils/exportfs/exportfs.c b/utils/exportfs/exportfs.c index 986a272..7432a65 100644 --- a/utils/exportfs/exportfs.c +++ b/utils/exportfs/exportfs.c @@ -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++) {