Checked correct file descriptor after call to `dup`.

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


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

Branch: refs/heads/1.0.x
Commit: 54695e5bcfa9c238d29710a12f53e0bff39e0002
Parents: f67964d
Author: Benjamin Bannier <benjamin.bann...@mesosphere.io>
Authored: Tue Sep 13 11:43:19 2016 +0200
Committer: Joseph Wu <josep...@apache.org>
Committed: Thu Sep 15 09:58:18 2016 -0700

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


http://git-wip-us.apache.org/repos/asf/mesos/blob/54695e5b/3rdparty/libprocess/src/libevent_ssl_socket.cpp
----------------------------------------------------------------------
diff --git a/3rdparty/libprocess/src/libevent_ssl_socket.cpp 
b/3rdparty/libprocess/src/libevent_ssl_socket.cpp
index 93a33e5..26eafc1 100644
--- a/3rdparty/libprocess/src/libevent_ssl_socket.cpp
+++ b/3rdparty/libprocess/src/libevent_ssl_socket.cpp
@@ -749,7 +749,7 @@ Future<size_t> LibeventSSLSocketImpl::sendfile(
   // we may use `evbuffer_file_segment_new` and `evbuffer_add_file_segment`
   // instead of `evbuffer_add_file`.
   int owned_fd = dup(fd);
-  if (fd == -1) {
+  if (owned_fd < 0) {
     return Failure(ErrnoError("Failed to duplicate file descriptor"));
   }
 

Reply via email to