mirror of
https://github.com/libvirt/libvirt.git
synced 2025-02-25 18:55:26 -06:00
cgroup: don't include sys/mount.h if not needed
As cgroup implementation only works on Linux, it does not make much sense to include sys/mount.h if other requirements are not met, such as HAVE_MNTENT_H and HAVE_GETMNTENT_R. Also, it fixes build on OpenBSD that requires to include sys/param.h along with sys/mount.h. Signed-off-by: Roman Bogorodskiy <bogorodskiy@gmail.com>
This commit is contained in:
parent
f7d0f12407
commit
1b60f1b401
@ -24,10 +24,9 @@
|
|||||||
#include <config.h>
|
#include <config.h>
|
||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#if defined HAVE_MNTENT_H && defined HAVE_GETMNTENT_R
|
#if defined HAVE_MNTENT_H && defined HAVE_SYS_MOUNT_H \
|
||||||
|
&& defined HAVE_GETMNTENT_R
|
||||||
# include <mntent.h>
|
# include <mntent.h>
|
||||||
#endif
|
|
||||||
#if defined HAVE_SYS_MOUNT_H
|
|
||||||
# include <sys/mount.h>
|
# include <sys/mount.h>
|
||||||
#endif
|
#endif
|
||||||
#include <fcntl.h>
|
#include <fcntl.h>
|
||||||
|
Loading…
Reference in New Issue
Block a user