diff --git a/configure.in.in b/configure.in.in index a40c6d4..27aa668 100644 --- a/configure.in.in +++ b/configure.in.in @@ -12,7 +12,7 @@ m4_define([xfsm_version_minor], [5]) m4_define([xfsm_version_micro], [91]) m4_define([xfsm_version_nano], []) m4_define([xfsm_version_build], [@REVISION@]) -m4_define([xfsm_version_tag], []) +m4_define([xfsm_version_tag], [svn]) m4_define([xfsm_version], [xfsm_version_major().xfsm_version_minor().xfsm_version_micro()ifelse(xfsm_version_nano(), [], [], [.xfsm_version_nano()])ifelse(xfsm_version_tag(), [svn], [xfsm_version_tag()[-r]xfsm_version_build()], [])]) dnl Initialize autoconf @@ -48,7 +48,7 @@ AC_PROG_LIBTOOL() dnl check for standard header files AC_HEADER_STDC -AC_CHECK_HEADERS([asm/unistd.h errno.h fcntl.h limits.h linux/ioprio.h \ +AC_CHECK_HEADERS([asm/unistd.h errno.h fcntl.h limits.h \ netdb.h signal.h stdarg.h sys/param.h sys/resource.h \ sys/socket.h sys/time.h sys/wait.h sys/utsname.h time.h \ unistd.h]) @@ -128,6 +128,21 @@ else AC_MSG_RESULT([yes]) fi +dnl check for linux/ioprio.h, and also check that the header actually +dnl works, as some kernels have bad headers. using AC_CHECK_HEADERS() +dnl prints a scary warning with a request to report a bug if it fails, +dnl but we don't want that. +AC_MSG_CHECKING([whether linux/ioprio.h exists and actually works]) +AC_COMPILE_IFELSE([ +AC_INCLUDES_DEFAULT +#include + ], [linux_ioprio_works=yes], [linux_ioprio_works=no]) +AC_MSG_RESULT([$linux_ioprio_works]) +if test "x$linux_ioprio_works" = "xyes"; then + AC_DEFINE([HAVE_WORKING_LINUX_IOPRIO_H], [1], + [Defined if linux/ioprio.h not only exists, but works properly]) +fi + AC_OUTPUT([ Makefile xfce4-session.spec diff --git a/xfce4-session/xfsm-manager.c b/xfce4-session/xfsm-manager.c index 8bef5ac..626346f 100644 --- a/xfce4-session/xfsm-manager.c +++ b/xfce4-session/xfsm-manager.c @@ -51,15 +51,15 @@ # include # include # ifdef __NR_ioprio_set -# ifdef HAVE_LINUX_IOPRIO_H +# ifdef HAVE_WORKING_LINUX_IOPRIO_H # include -# else /* if !HAVE_LINUX_IOPRIO_H */ +# else /* if !HAVE_WORKING_LINUX_IOPRIO_H */ # define IOPRIO_CLASS_SHIFT (13) # define IOPRIO_PRIO_MASK ((1UL << IOPRIO_CLASS_SHIFT) - 1) # define IOPRIO_PRIO_VALUE(class, data) (((class) << IOPRIO_CLASS_SHIFT) | data) # define IOPRIO_WHO_PROCESS (1) # define IOPRIO_CLASS_IDLE (3) -# endif /* !HAVE_LINUX_IOPRIO_H */ +# endif /* !HAVE_WORKING_LINUX_IOPRIO_H */ # endif /* __NR_ioprio_set */ #endif /* HAVE_ASM_UNISTD_H */