]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Make CpuAffinitySet::applied() method non-const.
authorDmitry Kurochkin <dmitry.kurochkin@measurement-factory.com>
Thu, 30 Aug 2012 12:46:47 +0000 (06:46 -0600)
committerAmos Jeffries <squid3@treenet.co.nz>
Thu, 30 Aug 2012 12:46:47 +0000 (06:46 -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 13fbf7d421c4c991654aff56974d059287019ff5..f937f03fa27b2c94b417aae7a2a30149bbcc28b6 100644 (file)
@@ -67,8 +67,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);