From: Carlos Santos Date: Wed, 16 Oct 2019 11:22:14 +0000 (-0300) Subject: storage: fix build with musl libc X-Git-Tag: v5.9.0-rc1~178 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=8e0c590c145b03b951f914f1442621f3d07c88ec;p=thirdparty%2Flibvirt.git 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 --- 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"