提交 40648b15 编写于 作者: M Matthias Bolte

cygwin: Check explicitly for getmntent_r

Cygwin has mntent.h but lacks getmntent_r. Update preprocessor
checks to catch this combination.
上级 d1be0aef
...@@ -114,7 +114,7 @@ int qemudLoadDriverConfig(struct qemud_driver *driver, ...@@ -114,7 +114,7 @@ int qemudLoadDriverConfig(struct qemud_driver *driver,
return -1; return -1;
} }
#ifdef HAVE_MNTENT_H #if defined HAVE_MNTENT_H && defined HAVE_GETMNTENT_R
/* For privileged driver, try and find hugepage mount automatically. /* For privileged driver, try and find hugepage mount automatically.
* Non-privileged driver requires admin to create a dir for the * Non-privileged driver requires admin to create a dir for the
* user, chown it, and then let user configure it manually */ * user, chown it, and then let user configure it manually */
......
...@@ -12,7 +12,7 @@ ...@@ -12,7 +12,7 @@
#include <stdio.h> #include <stdio.h>
#include <stdint.h> #include <stdint.h>
#ifdef HAVE_MNTENT_H #if defined HAVE_MNTENT_H && defined HAVE_GETMNTENT_R
# include <mntent.h> # include <mntent.h>
#endif #endif
#include <fcntl.h> #include <fcntl.h>
...@@ -69,7 +69,7 @@ void virCgroupFree(virCgroupPtr *group) ...@@ -69,7 +69,7 @@ void virCgroupFree(virCgroupPtr *group)
VIR_FREE(*group); VIR_FREE(*group);
} }
#ifdef HAVE_MNTENT_H #if defined HAVE_MNTENT_H && defined HAVE_GETMNTENT_R
/* /*
* Process /proc/mounts figuring out what controllers are * Process /proc/mounts figuring out what controllers are
* mounted and where * mounted and where
...@@ -403,7 +403,7 @@ out: ...@@ -403,7 +403,7 @@ out:
} }
#ifdef HAVE_MNTENT_H #if defined HAVE_MNTENT_H && defined HAVE_GETMNTENT_R
static int virCgroupCpuSetInherit(virCgroupPtr parent, virCgroupPtr group) static int virCgroupCpuSetInherit(virCgroupPtr parent, virCgroupPtr group)
{ {
int i; int i;
...@@ -628,7 +628,7 @@ int virCgroupAddTask(virCgroupPtr group, pid_t pid) ...@@ -628,7 +628,7 @@ int virCgroupAddTask(virCgroupPtr group, pid_t pid)
* *
* Returns 0 on success * Returns 0 on success
*/ */
#ifdef HAVE_MNTENT_H #if defined HAVE_MNTENT_H && defined HAVE_GETMNTENT_R
int virCgroupForDriver(const char *name, int virCgroupForDriver(const char *name,
virCgroupPtr *group, virCgroupPtr *group,
int privileged, int privileged,
...@@ -682,7 +682,7 @@ int virCgroupForDriver(const char *name ATTRIBUTE_UNUSED, ...@@ -682,7 +682,7 @@ int virCgroupForDriver(const char *name ATTRIBUTE_UNUSED,
* *
* Returns 0 on success * Returns 0 on success
*/ */
#ifdef HAVE_MNTENT_H #if defined HAVE_MNTENT_H && defined HAVE_GETMNTENT_R
int virCgroupForDomain(virCgroupPtr driver, int virCgroupForDomain(virCgroupPtr driver,
const char *name, const char *name,
virCgroupPtr *group, virCgroupPtr *group,
......
...@@ -61,7 +61,7 @@ ...@@ -61,7 +61,7 @@
#if HAVE_CAPNG #if HAVE_CAPNG
# include <cap-ng.h> # include <cap-ng.h>
#endif #endif
#ifdef HAVE_MNTENT_H #if defined HAVE_MNTENT_H && defined HAVE_GETMNTENT_R
# include <mntent.h> # include <mntent.h>
#endif #endif
...@@ -2716,7 +2716,7 @@ int virGetGroupID(const char *name ATTRIBUTE_UNUSED, ...@@ -2716,7 +2716,7 @@ int virGetGroupID(const char *name ATTRIBUTE_UNUSED,
#endif /* HAVE_GETPWUID_R */ #endif /* HAVE_GETPWUID_R */
#ifdef HAVE_MNTENT_H #if defined HAVE_MNTENT_H && defined HAVE_GETMNTENT_R
/* search /proc/mounts for mount point of *type; return pointer to /* search /proc/mounts for mount point of *type; return pointer to
* malloc'ed string of the path if found, otherwise return NULL * malloc'ed string of the path if found, otherwise return NULL
* with errno set to an appropriate value. * with errno set to an appropriate value.
...@@ -2748,7 +2748,7 @@ cleanup: ...@@ -2748,7 +2748,7 @@ cleanup:
return ret; return ret;
} }
#else /* HAVE_MNTENT_H */ #else /* defined HAVE_MNTENT_H && defined HAVE_GETMNTENT_R */
char * char *
virFileFindMountPoint(const char *type ATTRIBUTE_UNUSED) virFileFindMountPoint(const char *type ATTRIBUTE_UNUSED)
...@@ -2758,7 +2758,7 @@ virFileFindMountPoint(const char *type ATTRIBUTE_UNUSED) ...@@ -2758,7 +2758,7 @@ virFileFindMountPoint(const char *type ATTRIBUTE_UNUSED)
return NULL; return NULL;
} }
#endif /* HAVE_MNTENT_H */ #endif /* defined HAVE_MNTENT_H && defined HAVE_GETMNTENT_R */
#ifndef PROXY #ifndef PROXY
# if defined(UDEVADM) || defined(UDEVSETTLE) # if defined(UDEVADM) || defined(UDEVSETTLE)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册