-#ifndef MNTTAB
-# if defined(_PATH_MOUNTED)
-# define MNTTAB _PATH_MOUNTED
-# elif defined(MNT_MNTTAB)
-# define MNTTAB MNT_MNTTAB
-# elif defined(MNTTABNAME)
-# define MNTTAB MNTTABNAME
-# elif defined(KMTAB)
-# define MNTTAB KMTAB
-# else
-# define MNTTAB "/etc/mnttab"
-# endif
+#if HAVE_PATHS_H
+# include <paths.h>
+#endif
+
+#ifdef COLLECTD_MNTTAB
+# undef COLLECTD_MNTTAB
+#endif
+
+#if defined(_PATH_MOUNTED) /* glibc */
+# define COLLECTD_MNTTAB _PATH_MOUNTED
+#elif defined(MNTTAB) /* Solaris */
+# define COLLECTD_MNTTAB MNTTAB
+#elif defined(MNT_MNTTAB)
+# define COLLECTD_MNTTAB MNT_MNTTAB
+#elif defined(MNTTABNAME)
+# define COLLECTD_MNTTAB MNTTABNAME
+#elif defined(KMTAB)
+# define COLLECTD_MNTTAB KMTAB
+#else
+# define COLLECTD_MNTTAB "/etc/mnttab"