From 8e0c590c145b03b951f914f1442621f3d07c88ec Mon Sep 17 00:00:00 2001 From: Carlos Santos Date: Wed, 16 Oct 2019 08:22:14 -0300 Subject: [PATCH] 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 Signed-off-by: Michal Privoznik Reviewed-by: Michal Privoznik --- src/storage/storage_backend_fs.c | 1 + src/storage/storage_backend_vstorage.c | 1 + 2 files changed, 2 insertions(+) diff --git a/src/storage/storage_backend_fs.c b/src/storage/storage_backend_fs.c index d96f5a5cb5..ad993c656f 100644 --- a/src/storage/storage_backend_fs.c +++ b/src/storage/storage_backend_fs.c @@ -42,6 +42,7 @@ VIR_LOG_INIT("storage.storage_backend_fs"); #if WITH_STORAGE_FS # include +# include struct _virNetfsDiscoverState { const char *host; diff --git a/src/storage/storage_backend_vstorage.c b/src/storage/storage_backend_vstorage.c index ef51f254a8..8a4023014d 100644 --- a/src/storage/storage_backend_vstorage.c +++ b/src/storage/storage_backend_vstorage.c @@ -7,6 +7,7 @@ #include "virlog.h" #include "virstring.h" #include +#include #include #include #include "storage_util.h"