Inside of virschematest.c there's testSchemaDir() which iterates
over dentries in given directory but skips some files: those
without ".xml" suffix, hidden files, symlinks, etc.
Now, symlinks are detected as g_lstat() + S_ISLNK() combo which
works, except it fails to compile on mingw where is no concept of
symlinks. Replace the combo with a call to virFileIsLink() which
at least allows us to compile cleanly on mingw.
Fixes: f997fcca71a16b102e6ee663a3fb86bed8de9d7d
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
while ((rc = virDirRead(dir, &ent, dir_path)) > 0) {
g_autofree char *xml_path = NULL;
bool exception = false;
- GStatBuf sb;
if (!virStringHasSuffix(ent->d_name, ".xml"))
continue;
if (ent->d_name[0] == '.')
continue;
- if (g_lstat(ent->d_name, &sb) >= 0 &&
- S_ISLNK(sb.st_mode))
+ if (virFileIsLink(ent->d_name))
continue;
if (filter &&
!g_regex_match(filter, ent->d_name, 0, NULL))