summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlan Coopersmith <alan.coopersmith@oracle.com>2024-02-11 15:59:33 -0800
committerAlan Coopersmith <alan.coopersmith@oracle.com>2024-02-11 16:07:05 -0800
commitde7b5bb18da4e5a626794db292f8b41d30aa2232 (patch)
tree46d5d126c13e3daf5f65fe3f3c8c6129db1f5386
parentf16d6f2c273c6896a4e79ac9db7a80c830794392 (diff)
Use autoconf to check for <paths.h> instead of ifdef BSD
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
-rw-r--r--configure.ac2
-rw-r--r--get_load.c30
2 files changed, 17 insertions, 15 deletions
diff --git a/configure.ac b/configure.ac
index ed5b51f..fa66a66 100644
--- a/configure.ac
+++ b/configure.ac
@@ -72,6 +72,8 @@ AM_CONDITIONAL(USE_GETTEXT, test "x$USE_GETTEXT" = "xyes")
# BSD & GNU libc use <stdlib.h>, Solaris requires <sys/loadavg.h>
AC_CHECK_FUNCS([getloadavg], [AC_CHECK_HEADERS([sys/loadavg.h])])
+AC_CHECK_HEADERS([paths.h])
+
# Checks for pkg-config packages
PKG_CHECK_MODULES(XLOAD, xaw7 xmu xt x11 [xproto >= 7.0.17])
diff --git a/get_load.c b/get_load.c
index 918e27e..b00dfff 100644
--- a/get_load.c
+++ b/get_load.c
@@ -365,21 +365,21 @@ void GetLoadPoint(
/*
* provide default for everyone else
*/
-/* If a BSD system, check in <paths.h> */
-# ifdef BSD
-# include <paths.h>
-# ifdef _PATH_UNIX
-# define KERNEL_FILE _PATH_UNIX
-# else
-# ifdef _PATH_KERNEL
-# define KERNEL_FILE _PATH_KERNEL
-# else
-# define KERNEL_FILE "/vmunix"
-# endif
-# endif
-# else /* BSD */
-# define KERNEL_FILE "/vmunix"
-# endif /* BSD */
+/* If <paths.h> exists, check in it */
+# ifdef HAVE_PATHS_H
+# include <paths.h>
+# ifdef _PATH_UNIX
+# define KERNEL_FILE _PATH_UNIX
+# else
+# ifdef _PATH_KERNEL
+# define KERNEL_FILE _PATH_KERNEL
+# else
+# define KERNEL_FILE "/vmunix"
+# endif
+# endif
+# else /* HAVE_PATHS_H */
+# define KERNEL_FILE "/vmunix"
+# endif /* HAVE_PATHS_H */
# endif /* KERNEL_FILE */