mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-12-22 05:35:25 +00:00
storage: fix build with musl libc
On musl _PATH_MOUNTED is defined in paths.h, not in mntent.h, which causes compilation errors: storage/storage_backend_fs.c: In function 'virStorageBackendFileSystemIsMounted': storage/storage_backend_fs.c:255:23: error: '_PATH_MOUNTED' undeclared (first use in this function); did you mean 'XPATH_POINT'? if ((mtab = fopen(_PATH_MOUNTED, "r")) == NULL) { ^~~~~~~~~~~~~ XPATH_POINT Fix this including paths.h if _PATH_MOUNTED is still not defined after including mntent.h. This also works with glibc and uClibc-ng. Signed-off-by: Carlos Santos <casantos@redhat.com> Signed-off-by: Michal Privoznik <mprivozn@redhat.com> Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
This commit is contained in:
parent
44d63ad997
commit
8e0c590c14
@ -42,6 +42,7 @@ VIR_LOG_INIT("storage.storage_backend_fs");
|
||||
#if WITH_STORAGE_FS
|
||||
|
||||
# include <mntent.h>
|
||||
# include <paths.h>
|
||||
|
||||
struct _virNetfsDiscoverState {
|
||||
const char *host;
|
||||
|
@ -7,6 +7,7 @@
|
||||
#include "virlog.h"
|
||||
#include "virstring.h"
|
||||
#include <mntent.h>
|
||||
#include <paths.h>
|
||||
#include <pwd.h>
|
||||
#include <grp.h>
|
||||
#include "storage_util.h"
|
||||
|
Loading…
Reference in New Issue
Block a user