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/f67964d8
Tree: http://git-wip-us.apache.org/repos/asf/mesos/tree/f67964d8
Diff: http://git-wip-us.apache.org/repos/asf/mesos/diff/f67964d8

Branch: refs/heads/1.0.x
Commit: f67964d8591ae4f8176745a4a3951a1edbfd63ce
Parents: 4c5bdd6
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 09:58:18 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/f67964d8/3rdparty/libprocess/src/encoder.hpp
----------------------------------------------------------------------
diff --git a/3rdparty/libprocess/src/encoder.hpp 
b/3rdparty/libprocess/src/encoder.hpp
index 9cd0d3f..af083d1 100644
--- a/3rdparty/libprocess/src/encoder.hpp
+++ b/3rdparty/libprocess/src/encoder.hpp
@@ -256,7 +256,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