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

Branch: refs/heads/0.27.x
Commit: 0e51b6cc86fc063826725b7095615dae3b0e0140
Parents: d756d1b
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:22:21 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/0e51b6cc/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