]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Make CpuAffinitySet::applied() method non-const.
authorDmitry Kurochkin <dmitry.kurochkin@measurement-factory.com>
Sun, 9 Sep 2012 10:03:38 +0000 (04:03 -0600)
committerAmos Jeffries <squid3@treenet.co.nz>
Sun, 9 Sep 2012 10:03:38 +0000 (04:03 -0600)
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
src/CpuAffinitySet.h

index 5de3e17ec1f3d9074afce9fcab257d478b920489..3ba5a8fa2eb4a48bd5a827dd9938f76450f5e2d0 100644 (file)
@@ -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);
 }
 
index c5890f47a11b8e87f572e0bfa89e24ded90f5e79..f2b115772dc938aeda58760c803dfd8e7d7fd91b 100644 (file)
@@ -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);