From 60b9b76b466ad62a9f64f2eb7557a2563bbbf683 Mon Sep 17 00:00:00 2001 From: falkTX Date: Mon, 7 Feb 2022 22:23:09 +0000 Subject: [PATCH] Only use on Linux Signed-off-by: falkTX --- distrho/extra/sofd/libsofd.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/distrho/extra/sofd/libsofd.c b/distrho/extra/sofd/libsofd.c index ad8eca48..1d903840 100644 --- a/distrho/extra/sofd/libsofd.c +++ b/distrho/extra/sofd/libsofd.c @@ -338,7 +338,6 @@ const char *x_fib_recent_file(const char *appname) { } #ifdef HAVE_X11 -#include #include #include @@ -347,6 +346,11 @@ const char *x_fib_recent_file(const char *appname) { #include #include +#if defined(__linux__) || defined(__linux) +#define HAVE_MNTENT +#include +#endif + #ifndef MIN #define MIN(A,B) ( (A) < (B) ? (A) : (B) ) #endif @@ -1766,6 +1770,7 @@ static int parse_gtk_bookmarks (Display *dpy, const char *fn) { return found; } +#ifdef HAVE_MNTENT static const char *ignore_mountpoints[] = { "/bin", "/boot", "/dev", "/etc", "/lib", "/live", "/mnt", "/opt", @@ -1840,6 +1845,7 @@ static int read_mtab (Display *dpy, const char *mtab) { fclose (mt); return found; } +#endif static void populate_places (Display *dpy) { char tmp[1024]; @@ -1868,9 +1874,11 @@ static void populate_places (Display *dpy) { parse_gtk_bookmarks (dpy, _fib_cfg_custom_places); } +#ifdef HAVE_MNTENT if (read_mtab (dpy, "/proc/mounts") < 1) { read_mtab (dpy, "/etc/mtab"); } +#endif int parsed_bookmarks = 0; if (!parsed_bookmarks && getenv ("HOME")) {