[Xfce4-commits] <tumbler:master> Fix sched_getparam/sched_setscheduler code on OpenBSD (bug #6061).

Jannis Pohlmann noreply at xfce.org
Sun Nov 7 14:52:01 CET 2010


Updating branch refs/heads/master
         to edad4f4a34e9c0c61ba6f09415b6b892583a7fda (commit)
       from 42d3f8f036e9454e8043919567661b2ac6db839f (commit)

commit edad4f4a34e9c0c61ba6f09415b6b892583a7fda
Author: Jannis Pohlmann <jannis at xfce.org>
Date:   Sun Nov 7 14:49:18 2010 +0100

    Fix sched_getparam/sched_setscheduler code on OpenBSD (bug #6061).
    
    The check for sched.h and linux/sched.h is not enough. We also need to
    check for sched_getparam() and sched_setscheduler(), as on OpenBSD has
    no implementation of these functions.

 configure.ac                                |    2 +-
 plugins/jpeg-thumbnailer/jpeg-thumbnailer.c |    3 +++
 tumblerd/tumbler-scheduler.c                |    4 ++--
 3 files changed, 6 insertions(+), 3 deletions(-)

diff --git a/configure.ac b/configure.ac
index c0ef2cb..e7e548d 100644
--- a/configure.ac
+++ b/configure.ac
@@ -114,7 +114,7 @@ dnl ************************************
 dnl *** Check for standard functions ***
 dnl ************************************
 AC_FUNC_MMAP()
-#AC_CHECK_FUNCS([])
+AC_CHECK_FUNCS([sched_getparam sched_setscheduler])
 
 dnl ******************************
 dnl *** Check for i18n support ***
diff --git a/plugins/jpeg-thumbnailer/jpeg-thumbnailer.c b/plugins/jpeg-thumbnailer/jpeg-thumbnailer.c
index 20e9e98..2d55046 100644
--- a/plugins/jpeg-thumbnailer/jpeg-thumbnailer.c
+++ b/plugins/jpeg-thumbnailer/jpeg-thumbnailer.c
@@ -32,6 +32,9 @@
 #ifdef HAVE_SYS_STAT_H
 #include <sys/stat.h>
 #endif
+#ifdef HAVE_SYS_TYPES_H
+#include <sys/types.h>
+#endif
 
 #ifdef HAVE_FCNTL_H
 #include <fcntl.h>
diff --git a/tumblerd/tumbler-scheduler.c b/tumblerd/tumbler-scheduler.c
index 4ce2529..7dbbe7c 100644
--- a/tumblerd/tumbler-scheduler.c
+++ b/tumblerd/tumbler-scheduler.c
@@ -338,7 +338,7 @@ ioprio_set (int which, int who, int ioprio_val)
 void
 tumbler_scheduler_thread_use_lower_priority (void)
 {
-#ifdef HAVE_SCHED_H
+#if defined (HAVE_sched_getparam) && defined (HAVE_sched_setscheduler)
   struct sched_param sp;
 #endif
   int                ioprio;
@@ -349,7 +349,7 @@ tumbler_scheduler_thread_use_lower_priority (void)
 
   ioprio_set (IOPRIO_WHO_PROCESS, 0, ioprio | ioclass);
 
-#ifdef HAVE_SCHED_H
+#if defined (HAVE_sched_getparam) && defined (HAVE_sched_setscheduler)
   if (sched_getparam (0, &sp) == 0) 
     sched_setscheduler (0, SCHED_IDLE, &sp);
 #endif



More information about the Xfce4-commits mailing list