diff options
| author | Bernie Innocenti <codewiz@google.com> | 2018-06-03 16:19:51 +0900 |
|---|---|---|
| committer | Bernie Innocenti <codewiz@google.com> | 2018-06-07 16:31:04 +0900 |
| commit | 15bb55c11df22b4752297f38b10afd9e48806d87 (patch) | |
| tree | 6a89c1b621b2a642bb9d08865847ee263ea1e693 /server/InterfaceController.cpp | |
| parent | 992d7476b63b736b5f41e8b548d88a79db999fc4 (diff) | |
netd: Enable clang-tidy and fix all warnings
Bug: 65246407
Test: m netd && system/netd/tests/runtests.sh
Change-Id: I1d22b2bc317fe7218ccde78859ed0623d6a1f8df
Diffstat (limited to 'server/InterfaceController.cpp')
| -rw-r--r-- | server/InterfaceController.cpp | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/server/InterfaceController.cpp b/server/InterfaceController.cpp index 7258ee6e..34b8004a 100644 --- a/server/InterfaceController.cpp +++ b/server/InterfaceController.cpp @@ -107,8 +107,9 @@ int writeValueToPath( } // Run @fn on each interface as well as 'default' in the path @dirname. -void forEachInterface(const std::string& dirname, - std::function<void(const std::string& path, const std::string& iface)> fn) { +void forEachInterface( + const std::string& dirname, + const std::function<void(const std::string& path, const std::string& iface)>& fn) { // Run on default, which controls the behavior of any interfaces that are created in the future. fn(dirname, "default"); DIR* dir = opendir(dirname.c_str()); @@ -190,7 +191,9 @@ Status setProperty(const std::string& key, const std::string& val) { } // namespace android::netdutils::Status InterfaceController::enableStablePrivacyAddresses( - const std::string& iface, GetPropertyFn getProperty, SetPropertyFn setProperty) { + const std::string& iface, + const GetPropertyFn& getProperty, + const SetPropertyFn& setProperty) { const auto& sys = sSyscalls.get(); const std::string procTarget = std::string(ipv6_proc_path) + "/" + iface + "/stable_secret"; auto procFd = sys.open(procTarget, O_CLOEXEC | O_WRONLY); |
