[libvirt] [PATCH 1/2] build: fix build on cygwin

On cygwin: CC libvirt_util_la-cgroup.lo util/cgroup.c: In function 'virCgroupKillRecursiveInternal': util/cgroup.c:1458: warning: implicit declaration of function 'virCgroupNew' [-Wimplicit-function-declaration] * src/util/cgroup.c (virCgroupKill): Don't build on platforms where virCgroupNew is unsupported. --- Pushing under the build-breaker rule. And this time, it really was a cygwin failure ;) src/util/cgroup.c | 6 +++--- 1 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/util/cgroup.c b/src/util/cgroup.c index c5b8cdd..8551acd 100644 --- a/src/util/cgroup.c +++ b/src/util/cgroup.c @@ -1308,7 +1308,7 @@ int virCgroupGetFreezerState(virCgroupPtr group, char **state) } -#ifdef HAVE_KILL +#if defined HAVE_KILL && defined HAVE_MNTENT_H && defined HAVE_GETMNTENT_R static int virCgroupKillInternal(virCgroupPtr group, int signum, virHashTablePtr pids) { int rc; @@ -1523,7 +1523,7 @@ int virCgroupKillPainfully(virCgroupPtr group) return rc; } -#else /* HAVE_KILL */ +#else /* !(HAVE_KILL, HAVE_MNTENT_H, HAVE_GETMNTENT_R) */ int virCgroupKill(virCgroupPtr group ATTRIBUTE_UNUSED, int signum ATTRIBUTE_UNUSED) { @@ -1539,4 +1539,4 @@ int virCgroupKillPainfully(virCgroupPtr group ATTRIBUTE_UNUSED) { return -ENOSYS; } -#endif /* HAVE_KILL */ +#endif /* HAVE_KILL, HAVE_MNTENT_H, HAVE_GETMNTENT_R */ -- 1.7.4

On cygwin: CC libvirt_driver_security_la-security_dac.lo security/security_dac.c: In function 'virSecurityDACSetProcessLabel': security/security_dac.c:618: warning: format '%d' expects type 'int', but argument 7 has type 'uid_t' [-Wformat] We've done this before (see src/util/util.c). * src/security/security_dac.c (virSecurityDACSetProcessLabel): On cygwin, uid_t is a 32-bit long. --- Pushing under the trivial rule (I can't yet enable -Werror on cygwin, because the <rpc.h> headers from tirpc aren't compile-clean - they redeclare setrpcent - otherwise I would be pushing under the build-breaker rule). src/security/security_dac.c | 3 ++- 1 files changed, 2 insertions(+), 1 deletions(-) diff --git a/src/security/security_dac.c b/src/security/security_dac.c index b8de232..fba2d1d 100644 --- a/src/security/security_dac.c +++ b/src/security/security_dac.c @@ -615,7 +615,8 @@ virSecurityDACSetProcessLabel(virSecurityManagerPtr mgr, { virSecurityDACDataPtr priv = virSecurityManagerGetPrivateData(mgr); - VIR_DEBUG("Dropping privileges of VM to %d:%d", priv->user, priv->group); + VIR_DEBUG("Dropping privileges of VM to %u:%u", + (unsigned int) priv->user, (unsigned int) priv->group); if (virSetUIDGID(priv->user, priv->group) < 0) return -1; -- 1.7.4
participants (1)
-
Eric Blake