]> xenbits.xensource.com Git - libvirt.git/commit
storage: fix build with musl libc
authorCarlos Santos <casantos@redhat.com>
Wed, 16 Oct 2019 11:22:14 +0000 (08:22 -0300)
committerMichal Privoznik <mprivozn@redhat.com>
Thu, 17 Oct 2019 08:59:26 +0000 (10:59 +0200)
commit8e0c590c145b03b951f914f1442621f3d07c88ec
tree87e6b8125da4cc817345d600197bc59e4bec8957
parent44d63ad997216f05f5c7ce005acc308bbdd00458
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>
src/storage/storage_backend_fs.c
src/storage/storage_backend_vstorage.c