Capture all boost::system::error_codes by ref

Capturing these possibly overloaded values by reference can avoid a copy
in some cases, and it's good to be consistent.

This change was made automatically by grep/sed.

Tested: Code compiles.

Signed-off-by: Ed Tanous <edtanous@google.com>
Change-Id: Iafeaca2a5dc52f39753b5a3880419d6bc943f81b
diff --git a/redfish-core/lib/aggregation_service.hpp b/redfish-core/lib/aggregation_service.hpp
index 9874d14..6c93613 100644
--- a/redfish-core/lib/aggregation_service.hpp
+++ b/redfish-core/lib/aggregation_service.hpp
@@ -66,7 +66,7 @@
 
 inline void populateAggregationSourceCollection(
     const std::shared_ptr<bmcweb::AsyncResp>& asyncResp,
-    const boost::system::error_code ec,
+    const boost::system::error_code& ec,
     const std::unordered_map<std::string, boost::urls::url>& satelliteInfo)
 {
     // Something went wrong while querying dbus
@@ -138,7 +138,7 @@
 inline void populateAggregationSource(
     const std::string& aggregationSourceId,
     const std::shared_ptr<bmcweb::AsyncResp>& asyncResp,
-    const boost::system::error_code ec,
+    const boost::system::error_code& ec,
     const std::unordered_map<std::string, boost::urls::url>& satelliteInfo)
 {
     asyncResp->res.addHeader(
diff --git a/redfish-core/lib/systems.hpp b/redfish-core/lib/systems.hpp
index 736b158..1cedf2d 100644
--- a/redfish-core/lib/systems.hpp
+++ b/redfish-core/lib/systems.hpp
@@ -2974,7 +2974,7 @@
         if (protocolName == "SSH")
         {
             getPortNumber(socketPath, [asyncResp, protocolName](
-                                          const boost::system::error_code ec1,
+                                          const boost::system::error_code& ec1,
                                           int portNumber) {
                 if (ec1)
                 {
diff --git a/redfish-core/lib/update_service.hpp b/redfish-core/lib/update_service.hpp
index 7c8ce01..ddb46f6 100644
--- a/redfish-core/lib/update_service.hpp
+++ b/redfish-core/lib/update_service.hpp
@@ -575,7 +575,7 @@
 
     // Set the requested image apply time value
     crow::connections::systemBus->async_method_call(
-        [asyncResp](const boost::system::error_code ec) {
+        [asyncResp](const boost::system::error_code& ec) {
         if (ec)
         {
             BMCWEB_LOG_ERROR << "D-Bus responses error: " << ec;