summaryrefslogtreecommitdiff
path: root/server/TetherController.cpp
diff options
context:
space:
mode:
authorDan Albert <danalbert@google.com>2015-03-14 23:54:37 +0000
committerGerrit Code Review <noreply-gerritcodereview@google.com>2015-03-14 23:54:38 +0000
commite37344992f49c8e0e6e9b816f590afbd00a961ca (patch)
treeafb5171b6e804b87a0a0aedd0742f36283b3bd64 /server/TetherController.cpp
parent909757cfc276546652d8f6d433c56d644325af8c (diff)
parentb67219a71d1d896bcb34c4a7a797824b88515b2c (diff)
Merge "Update for libbase."
Diffstat (limited to 'server/TetherController.cpp')
-rw-r--r--server/TetherController.cpp9
1 files changed, 6 insertions, 3 deletions
diff --git a/server/TetherController.cpp b/server/TetherController.cpp
index c9a93fd6..44c7e35a 100644
--- a/server/TetherController.cpp
+++ b/server/TetherController.cpp
@@ -27,16 +27,19 @@
#include <netinet/in.h>
#include <arpa/inet.h>
+#include <base/file.h>
#define LOG_TAG "TetherController"
#include <cutils/log.h>
#include <cutils/properties.h>
-#include <utils/file.h>
#include "Fwmark.h"
#include "NetdConstants.h"
#include "Permission.h"
#include "TetherController.h"
+using android::base::ReadFileToString;
+using android::base::WriteStringToFile;
+
TetherController::TetherController() {
mInterfaces = new InterfaceCollection();
mDnsNetId = 0;
@@ -67,7 +70,7 @@ int TetherController::setIpFwdEnabled(bool enable) {
return 0;
}
- if (!android::WriteStringToFile(enable ? "1" : "0", "/proc/sys/net/ipv4/ip_forward")) {
+ if (!WriteStringToFile(enable ? "1" : "0", "/proc/sys/net/ipv4/ip_forward")) {
ALOGE("Failed to write ip_forward (%s)", strerror(errno));
return -1;
}
@@ -77,7 +80,7 @@ int TetherController::setIpFwdEnabled(bool enable) {
bool TetherController::getIpFwdEnabled() {
std::string enabled;
- if (!android::ReadFileToString("/proc/sys/net/ipv4/ip_forward", &enabled)) {
+ if (!ReadFileToString("/proc/sys/net/ipv4/ip_forward", &enabled)) {
ALOGE("Failed to read ip_forward (%s)", strerror(errno));
return -1;
}