]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
cgroup: Fix compilation broken on MinGW due to dirent->d_type
authorRyota Ozaki <ozaki.ryota@gmail.com>
Wed, 30 Jun 2010 11:49:28 +0000 (20:49 +0900)
committerEric Blake <eblake@redhat.com>
Wed, 30 Jun 2010 14:32:23 +0000 (08:32 -0600)
As pointed out by Eric Blake, using dirent->d_type breaks
compilation on MinGW. This patch addresses this by using
'#if defined' as same as doing for virCgroupForDriver.

src/util/cgroup.c

index 9fa64dca2ff1aaa9f3e42a53e52fac249558bf61..024036af37372c75ebb5639442f8558195270edf 100644 (file)
@@ -608,6 +608,7 @@ cleanup:
 }
 #endif
 
+#if defined _DIRENT_HAVE_D_TYPE
 static int virCgroupRemoveRecursively(char *grppath)
 {
     DIR *grpdir;
@@ -656,6 +657,13 @@ static int virCgroupRemoveRecursively(char *grppath)
 
     return rc;
 }
+#else
+static int virCgroupRemoveRecursively(char *grppath ATTRIBUTE_UNUSED)
+{
+    /* Claim no support */
+    return -ENXIO;
+}
+#endif
 
 /**
  * virCgroupRemove: