patch-tombupnp_threadutil_src_ThreadPool_c 1.2 KB

12345678910111213141516171819202122232425
  1. $OpenBSD: patch-tombupnp_threadutil_src_ThreadPool_c,v 1.4 2013/01/27 14:13:30 brad Exp $
  2. --- tombupnp/threadutil/src/ThreadPool.c.orig Thu Mar 25 10:58:13 2010
  3. +++ tombupnp/threadutil/src/ThreadPool.c Sun Jan 27 08:51:59 2013
  4. @@ -141,7 +141,8 @@ SetPolicyType( PolicyType in )
  5. static int
  6. SetPriority( ThreadPriority priority )
  7. {
  8. -#if defined(HAVE_SCHED_GET_PRIORITY_MIN) && defined(HAVE_SCHED_GET_PRIORITY_MAX)
  9. +#if defined(_POSIX_THREAD_PRIORITY_SCHEDULING) && (_POSIX_THREAD_PRIORITY_SCHEDULING > 0)
  10. + && defined(HAVE_SCHED_GET_PRIORITY_MIN) && defined(HAVE_SCHED_GET_PRIORITY_MAX)
  11. int currentPolicy;
  12. int minPriority = 0;
  13. int maxPriority = 0;
  14. @@ -372,8 +373,8 @@ tp->stats.totalJobsLQ++; tp->stats.totalTimeLQ += diff
  15. gettimeofday( &t, NULL );
  16. #if defined(WIN32)
  17. srand( ( unsigned int )(t.tv_usec/1000) + (unsigned int)ithread_get_current_thread_id( ).p );
  18. -#elif defined(__FreeBSD__) || defined (__APPLE__) || defined(__OpenBSD__) || defined(__NetBSD__)
  19. - srand( ( unsigned int )(t.tv_usec/1000) + (unsigned int)ithread_get_current_thread_id( ) );
  20. +#elif defined(HAVE_ARC4RANDOM)
  21. + srand( arc4random() );
  22. #else
  23. srand( ( unsigned int )(t.tv_usec/1000) + ithread_get_current_thread_id( ) );
  24. #endif