summaryrefslogtreecommitdiff
path: root/server/BandwidthController.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'server/BandwidthController.cpp')
-rw-r--r--server/BandwidthController.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/server/BandwidthController.cpp b/server/BandwidthController.cpp
index 2fe249d0..e5cf36cc 100644
--- a/server/BandwidthController.cpp
+++ b/server/BandwidthController.cpp
@@ -786,7 +786,7 @@ int BandwidthController::getInterfaceQuota(const char *costName, int64_t *bytes)
return -1;
asprintf(&fname, "/proc/net/xt_quota/%s", costName);
- fp = fopen(fname, "r");
+ fp = fopen(fname, "re");
free(fname);
if (!fp) {
ALOGE("Reading quota %s failed (%s)", costName, strerror(errno));
@@ -843,7 +843,7 @@ int BandwidthController::updateQuota(const char *quotaName, int64_t bytes) {
}
asprintf(&fname, "/proc/net/xt_quota/%s", quotaName);
- fp = fopen(fname, "w");
+ fp = fopen(fname, "we");
free(fname);
if (!fp) {
ALOGE("Updating quota %s failed (%s)", quotaName, strerror(errno));