+
+ /*
+ * Make sure that path exists and is accessible.
+ * This is necessary since Cygwin implementation of nftw() is not POSIX
+ * compliant. Cygwin nftw() implementation does not fail on non-existent
+ * path with ENOENT. Instead, it flags the directory as FTW_NS. FTW_NS during
+ * nftw_append_all_from_dir is not treated as an error since we are
+ * traversing the tree for plugin discovery.
+ */
+ if (stat(path, &sb)) {
+ BT_LOGW_ERRNO("Cannot open directory",
+ ": path=\"%s\", recurse=%d",
+ path, recurse);
+ status = BT_FUNC_STATUS_ERROR;
+ goto end;
+ }
+