From 0ec84481458772c7f1e9105936053576f78b9c61 Mon Sep 17 00:00:00 2001 From: Dmitry Kurochkin Date: Sun, 9 Sep 2012 04:03:38 -0600 Subject: [PATCH] Make CpuAffinitySet::applied() method non-const. According to CPU_SET(3) and, apparently, on some systems (e.g., OpenSuSE 10.3) CPU_COUNT macro expects a non-const argument. The patch fixes build error on these systems. --- src/CpuAffinitySet.cc | 5 ++++- src/CpuAffinitySet.h | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/CpuAffinitySet.cc b/src/CpuAffinitySet.cc index 5de3e17ec1..3ba5a8fa2e 100644 --- a/src/CpuAffinitySet.cc +++ b/src/CpuAffinitySet.cc @@ -68,8 +68,11 @@ CpuAffinitySet::undo() } bool -CpuAffinitySet::applied() const +CpuAffinitySet::applied() { + // NOTE: cannot be const. + // According to CPU_SET(3) and, apparently, on some systems (e.g., + // OpenSuSE 10.3) CPU_COUNT macro expects a non-const argument. return (CPU_COUNT(&theOrigCpuSet) > 0); } diff --git a/src/CpuAffinitySet.h b/src/CpuAffinitySet.h index c5890f47a1..f2b115772d 100644 --- a/src/CpuAffinitySet.h +++ b/src/CpuAffinitySet.h @@ -21,7 +21,7 @@ public: void undo(); /// whether apply() was called and was not undone - bool applied() const; + bool applied(); /// set CPU affinity mask void set(const cpu_set_t &aCpuSet); -- 2.47.2