You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mesos.apache.org by bm...@apache.org on 2015/10/12 22:45:52 UTC

[1/2] mesos git commit: Fixed file descriptor leak from fts_open.

Repository: mesos
Updated Branches:
  refs/heads/master 5fa5458a1 -> faae791ab


Fixed file descriptor leak from fts_open.

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


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

Branch: refs/heads/master
Commit: 8e2afb3ccef19029253e7b65671b67fe00a72ae6
Parents: 5fa5458
Author: Chi Zhang <ch...@gmail.com>
Authored: Mon Oct 12 13:44:10 2015 -0700
Committer: Benjamin Mahler <be...@gmail.com>
Committed: Mon Oct 12 13:44:10 2015 -0700

----------------------------------------------------------------------
 .../3rdparty/stout/include/stout/posix/os.hpp           | 12 +++++++++---
 1 file changed, 9 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/mesos/blob/8e2afb3c/3rdparty/libprocess/3rdparty/stout/include/stout/posix/os.hpp
----------------------------------------------------------------------
diff --git a/3rdparty/libprocess/3rdparty/stout/include/stout/posix/os.hpp b/3rdparty/libprocess/3rdparty/stout/include/stout/posix/os.hpp
index 5d2f39d..a042d06 100644
--- a/3rdparty/libprocess/3rdparty/stout/include/stout/posix/os.hpp
+++ b/3rdparty/libprocess/3rdparty/stout/include/stout/posix/os.hpp
@@ -240,13 +240,17 @@ inline Try<Nothing> rmdir(const std::string& directory, bool recursive = true)
       switch (node->fts_info) {
         case FTS_DP:
           if (::rmdir(node->fts_path) < 0 && errno != ENOENT) {
-            return ErrnoError();
+            Error error = ErrnoError();
+            fts_close(tree);
+            return error;
           }
           break;
         case FTS_F:
         case FTS_SL:
           if (::unlink(node->fts_path) < 0 && errno != ENOENT) {
-            return ErrnoError();
+            Error error = ErrnoError();
+            fts_close(tree);
+            return error;
           }
           break;
         default:
@@ -255,7 +259,9 @@ inline Try<Nothing> rmdir(const std::string& directory, bool recursive = true)
     }
 
     if (errno != 0) {
-      return ErrnoError();
+      Error error = ErrnoError();
+      fts_close(tree);
+      return error;
     }
 
     if (fts_close(tree) < 0) {


[2/2] mesos git commit: Fixed file descriptor leak from fts_open.

Posted by bm...@apache.org.
Fixed file descriptor leak from fts_open.

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


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

Branch: refs/heads/master
Commit: faae791abb642686828b194ff37563e46d72064e
Parents: 8e2afb3
Author: Chi Zhang <ch...@gmail.com>
Authored: Mon Oct 12 13:44:41 2015 -0700
Committer: Benjamin Mahler <be...@gmail.com>
Committed: Mon Oct 12 13:45:34 2015 -0700

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


http://git-wip-us.apache.org/repos/asf/mesos/blob/faae791a/src/linux/cgroups.cpp
----------------------------------------------------------------------
diff --git a/src/linux/cgroups.cpp b/src/linux/cgroups.cpp
index 53c568b..f67633e 100644
--- a/src/linux/cgroups.cpp
+++ b/src/linux/cgroups.cpp
@@ -922,7 +922,10 @@ Try<vector<string>> get(const string& hierarchy, const string& cgroup)
   }
 
   if (errno != 0) {
-    return ErrnoError("Failed to read a node while traversing file system");
+    Error error =
+      ErrnoError("Failed to read a node while traversing file system");
+    fts_close(tree);
+    return error;
   }
 
   if (fts_close(tree) != 0) {