From fcb94de7ed99cacf16fbac13d1f7e048a4a6fb2a Mon Sep 17 00:00:00 2001 From: Robert Osfield Date: Thu, 19 Nov 2009 17:18:22 +0000 Subject: [PATCH] From Donn Mielcarek, "I'm surprised this hasn't come up before, but the function Thread::setProcessorAffinity always returns -1, even if the call is successful. I added return statements to each of the function calls." --- src/OpenThreads/pthreads/PThread.c++ | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/OpenThreads/pthreads/PThread.c++ b/src/OpenThreads/pthreads/PThread.c++ index e1eaf0c2e..db0b864b5 100644 --- a/src/OpenThreads/pthreads/PThread.c++ +++ b/src/OpenThreads/pthreads/PThread.c++ @@ -542,11 +542,11 @@ int Thread::setProcessorAffinity(unsigned int cpunum) CPU_ZERO( &cpumask ); CPU_SET( pd->cpunum, &cpumask ); #if defined(HAVE_PTHREAD_SETAFFINITY_NP) - pthread_setaffinity_np (pthread_self(), sizeof(cpumask), &cpumask); + return pthread_setaffinity_np (pthread_self(), sizeof(cpumask), &cpumask); #elif defined(HAVE_THREE_PARAM_SCHED_SETAFFINITY) - sched_setaffinity( 0, sizeof(cpumask), &cpumask ); + return sched_setaffinity( 0, sizeof(cpumask), &cpumask ); #elif defined(HAVE_TWO_PARAM_SCHED_SETAFFINITY) - sched_setaffinity( 0, &cpumask ); + return sched_setaffinity( 0, &cpumask ); #endif }