Added check in FileEncoder's destructor.

This check will force libprocess to fail fast if a file descriptor
is closed underneath it.

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


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

Branch: refs/heads/0.28.x
Commit: 1ccc07971d3195cd1ac6945a0063741755890131
Parents: 96d73c7
Author: Joseph Wu <jos...@mesosphere.io>
Authored: Tue Sep 13 14:11:50 2016 -0700
Committer: Joseph Wu <josep...@apache.org>
Committed: Thu Sep 15 10:18:44 2016 -0700

----------------------------------------------------------------------
 3rdparty/libprocess/src/encoder.hpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/mesos/blob/1ccc0797/3rdparty/libprocess/src/encoder.hpp
----------------------------------------------------------------------
diff --git a/3rdparty/libprocess/src/encoder.hpp 
b/3rdparty/libprocess/src/encoder.hpp
index 57e2805..a26e198 100644
--- a/3rdparty/libprocess/src/encoder.hpp
+++ b/3rdparty/libprocess/src/encoder.hpp
@@ -255,7 +255,7 @@ public:
 
   virtual ~FileEncoder()
   {
-    os::close(fd);
+    CHECK_SOME(os::close(fd)) << "Failed to close file descriptor";
   }
 
   virtual Kind kind() const

Reply via email to