[PATCH] virschematest: Replace g_lstat() with virFileIsLink()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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.

Signed-off-by: Michal Privoznik <mprivozn@xxxxxxxxxx>
---

The reason this isn't detected by our CI is that we explicitly build
libvirt with -Dtests=disabled which I missed when debugging latest build
error on mingw.

 tests/virschematest.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/tests/virschematest.c b/tests/virschematest.c
index 20ac495f4a..83bc945711 100644
--- a/tests/virschematest.c
+++ b/tests/virschematest.c
@@ -125,8 +125,7 @@ testSchemaDir(const char *schema,
             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))
-- 
2.44.2




[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]

  Powered by Linux