openbsd-ports/net/argus-clients/patches/patch-common_argus_main_c
2012-07-08 19:24:18 +00:00

22 lines
1.2 KiB
Plaintext

$OpenBSD: patch-common_argus_main_c,v 1.2 2012/07/08 19:24:18 steven Exp $
--- common/argus_main.c.orig Tue Apr 17 18:22:02 2012
+++ common/argus_main.c Wed Jun 27 22:51:25 2012
@@ -116,7 +116,7 @@ main (int argc, char **argv)
#if defined(ARGUS_THREADS)
int hosts = 0;
pthread_attr_t attr;
-#if defined(_POSIX_THREAD_PRIORITY_SCHEDULING) && !defined(sun) && !defined(CYGWIN)
+#if defined(_POSIX_THREAD_PRIORITY_SCHEDULING) && (_POSIX_THREAD_PRIORITY_SCHEDULING > 0) && !defined(sun) && !defined(CYGWIN)
int thread_policy;
struct sched_param thread_param;
#if defined(HAVE_SCHED_GET_PRIORITY_MIN)
@@ -140,7 +140,7 @@ main (int argc, char **argv)
if ((status = pthread_attr_init(&attr)) != 0)
ArgusLog (LOG_ERR, "pthreads init error");
-#if defined(_POSIX_THREAD_PRIORITY_SCHEDULING) && !defined(sun) && !defined(CYGWIN)
+#if defined(_POSIX_THREAD_PRIORITY_SCHEDULING) && (_POSIX_THREAD_PRIORITY_SCHEDULING > 0) && !defined(sun) && !defined(CYGWIN)
if ((status = pthread_attr_getschedpolicy(&attr, &thread_policy)) != 0)
ArgusLog (LOG_ERR, "pthreads get policy error");
if ((status = pthread_attr_getschedparam(&attr, &thread_param)) != 0)