+int parser_check_dir(struct discover_context *ctx,
+ struct discover_device *dev, const char *dirname)
+{
+ struct stat statbuf;
+ char *path;
+ int rc;
+
+ if (!dev->mount_path)
+ return -1;
+
+ path = local_path(ctx, dev, dirname);
+
+ rc = stat(path, &statbuf);
+ talloc_free(path);
+ if (!rc)
+ return -1;
+
+ return S_ISDIR(statbuf.st_mode) ? 0 : -1;
+}
+