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/09/26 01:41:29 UTC

mesos git commit: Fixed a file descriptor leak in io::peek().

Repository: mesos
Updated Branches:
  refs/heads/master 1ab9618ef -> fbb12a529


Fixed a file descriptor leak in io::peek().

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


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

Branch: refs/heads/master
Commit: fbb12a52969710fe69c309c83db0a5441dbea886
Parents: 1ab9618
Author: Chi Zhang <ch...@gmail.com>
Authored: Fri Sep 25 16:40:28 2015 -0700
Committer: Benjamin Mahler <be...@gmail.com>
Committed: Fri Sep 25 16:41:20 2015 -0700

----------------------------------------------------------------------
 3rdparty/libprocess/src/io.cpp | 1 +
 1 file changed, 1 insertion(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/mesos/blob/fbb12a52/3rdparty/libprocess/src/io.cpp
----------------------------------------------------------------------
diff --git a/3rdparty/libprocess/src/io.cpp b/3rdparty/libprocess/src/io.cpp
index 88c37ba..d17ccf7 100644
--- a/3rdparty/libprocess/src/io.cpp
+++ b/3rdparty/libprocess/src/io.cpp
@@ -312,6 +312,7 @@ Future<size_t> peek(int fd, void* data, size_t size, size_t limit)
   // fixed in a newer version of libev (we use 3.8 at the time of
   // writing this comment).
   internal::read(fd, data, limit, internal::PEEK, promise, io::READ);
+  promise->future().onAny(lambda::bind(&os::close, fd));
 
   return promise->future();
 }