From b6f77397c506b96a99195eaa2fe7592796034d52 Mon Sep 17 00:00:00 2001 From: Ivailo Monev Date: Thu, 26 Aug 2021 01:44:23 +0300 Subject: [PATCH] kdecore: include paths header if present on the system fixes mount points detection on systems using musl libc Signed-off-by: Ivailo Monev --- ConfigureChecks.cmake | 1 + config.h.cmake | 1 + kdecore/io/kmountpoint.cpp | 4 ++++ 3 files changed, 6 insertions(+) diff --git a/ConfigureChecks.cmake b/ConfigureChecks.cmake index 19ef91a4..363ff231 100644 --- a/ConfigureChecks.cmake +++ b/ConfigureChecks.cmake @@ -38,6 +38,7 @@ check_include_files(sys/mntent.h HAVE_SYS_MNTENT_H) # solid, check_include_files("sys/param.h;sys/mount.h" HAVE_SYS_MOUNT_H) # kio, kdecore check_include_files(unistd.h HAVE_UNISTD_H) # various check_include_files(stdint.h HAVE_STDINT_H) # various +check_include_files(paths.h HAVE_PATHS_H) # kdecore check_include_files(sys/time.h HAVE_SYS_TIME_H) # various diff --git a/config.h.cmake b/config.h.cmake index 30f05eef..1d3f1665 100644 --- a/config.h.cmake +++ b/config.h.cmake @@ -19,6 +19,7 @@ #cmakedefine HAVE_LIMITS_H 1 #cmakedefine HAVE_MNTENT_H 1 #cmakedefine HAVE_UNISTD_H 1 +#cmakedefine HAVE_PATHS_H 1 #cmakedefine HAVE_BACKTRACE 1 #cmakedefine HAVE_GETMNTINFO 1 diff --git a/kdecore/io/kmountpoint.cpp b/kdecore/io/kmountpoint.cpp index 86a5e848..6e8d5cfb 100644 --- a/kdecore/io/kmountpoint.cpp +++ b/kdecore/io/kmountpoint.cpp @@ -31,6 +31,10 @@ static Qt::CaseSensitivity cs = Qt::CaseSensitive; +#ifdef HAVE_PATHS_H +#include // for _PATH_MOUNTED +#endif + #ifdef HAVE_SYS_MNTTAB_H #include #endif