From: Amos Jeffries Date: Sun, 9 Aug 2015 10:14:38 +0000 (-0700) Subject: Replace use of String in ProcessRoles() with SBuf X-Git-Tag: SQUID_4_0_1~142 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=1fdc4f422f91a57150aa5eae88d5115976e8b821;p=thirdparty%2Fsquid.git Replace use of String in ProcessRoles() with SBuf --- diff --git a/src/tests/stub_tools.cc b/src/tests/stub_tools.cc index 23d502a3c2..3090f35f58 100644 --- a/src/tests/stub_tools.cc +++ b/src/tests/stub_tools.cc @@ -59,8 +59,8 @@ bool IamCoordinatorProcess() STUB_RETVAL(false) bool IamPrimaryProcess() STUB_RETVAL(false) int NumberOfKids() STUB_RETVAL(0) -//not yet needed in the Stub, causes dependency on String -//String ProcessRoles() STUB_RETVAL(String()) +//not actually needed in the Stub, causes dependency on SBuf +//SBuf ProcessRoles() STUB_RETVAL(SBuf()) void writePidFile(void) STUB void removePidFile(void) STUB pid_t readPidFile(void) STUB_RETVAL(0) diff --git a/src/tools.cc b/src/tools.cc index b3b1a7fd7e..84ed023156 100644 --- a/src/tools.cc +++ b/src/tools.cc @@ -684,10 +684,10 @@ NumberOfKids() return (needCoord ? 1 : 0) + Config.workers + rockDirs; } -String +SBuf ProcessRoles() { - String roles = ""; + SBuf roles; if (IamMasterProcess()) roles.append(" master"); if (IamCoordinatorProcess()) diff --git a/src/tools.h b/src/tools.h index af185be442..afd055c7e5 100644 --- a/src/tools.h +++ b/src/tools.h @@ -12,7 +12,6 @@ #define SQUID_TOOLS_H_ #include "SBuf.h" -#include "SquidString.h" #include "typedefs.h" class MemBuf; @@ -76,7 +75,7 @@ bool UsingSmp(); // try using specific Iam*() checks above first /// number of Kid processes as defined in src/ipc/Kid.h int NumberOfKids(); /// a string describing this process roles such as worker or coordinator -String ProcessRoles(); +SBuf ProcessRoles(); void debug_trap(const char *);