You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mesos.apache.org by ji...@apache.org on 2014/06/27 20:20:37 UTC

git commit: Do not append endln on cgroup write.

Repository: mesos
Updated Branches:
  refs/heads/master 24ebd1ba8 -> 5bea0309e


Do not append endln on cgroup write.

Minor update to remove the endln appending to cgroup writes. This
causes issues in later kernels, I uncovered it in rawhide.

Review: https://reviews.apache.org/r/22979


Project: http://git-wip-us.apache.org/repos/asf/mesos/repo
Commit: http://git-wip-us.apache.org/repos/asf/mesos/commit/5bea0309
Tree: http://git-wip-us.apache.org/repos/asf/mesos/tree/5bea0309
Diff: http://git-wip-us.apache.org/repos/asf/mesos/diff/5bea0309

Branch: refs/heads/master
Commit: 5bea0309e920e858feee9caa6fdb81715de5fb56
Parents: 24ebd1b
Author: Timothy St. Clair <ts...@redhat.com>
Authored: Fri Jun 27 11:19:13 2014 -0700
Committer: Jie Yu <yu...@gmail.com>
Committed: Fri Jun 27 11:20:20 2014 -0700

----------------------------------------------------------------------
 src/linux/cgroups.cpp | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/mesos/blob/5bea0309/src/linux/cgroups.cpp
----------------------------------------------------------------------
diff --git a/src/linux/cgroups.cpp b/src/linux/cgroups.cpp
index 0a6c76f..6a73dd7 100644
--- a/src/linux/cgroups.cpp
+++ b/src/linux/cgroups.cpp
@@ -395,7 +395,10 @@ static Try<Nothing> write(
     return Error("Failed to open file " + path);
   }
 
-  file << value << std::endl;
+  // NOTE: cgroups convention does not append a endln!
+  // Recent kernels will cause operations to fail if 'endl' is
+  // appended to the control file.
+  file << value;
 
   if (file.fail()) {
     ErrnoError error; // TODO(jieyu): Does std::ifstream actually set errno?