You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mesos.apache.org by mp...@apache.org on 2017/02/07 02:28:30 UTC

[1/2] mesos git commit: Fixed incorrect `CHECK_EQ`s in `WindowsFD`.

Repository: mesos
Updated Branches:
  refs/heads/master ca240948e -> 974581bdb


Fixed incorrect `CHECK_EQ`s in `WindowsFD`.

We store both the `CRT` and `HANDLE` in `WindowsFD` whether we construct
from `CRT` or `HANDLE` by using `_get_osfhandle` and `_open_osfhandle`.

Thus, accessing the `CRT` via `crt()` does not require that it be in the
`CRT` state, but rather `CRT` or `HANDLE`, for example.

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


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

Branch: refs/heads/master
Commit: 7ff8cd49e43eb33b9faeffce836a2276484848a7
Parents: ca24094
Author: Michael Park <mp...@apache.org>
Authored: Mon Feb 6 14:25:05 2017 -0800
Committer: Michael Park <mp...@apache.org>
Committed: Mon Feb 6 16:10:49 2017 -0800

----------------------------------------------------------------------
 3rdparty/stout/include/stout/os/windows/fd.hpp | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/mesos/blob/7ff8cd49/3rdparty/stout/include/stout/os/windows/fd.hpp
----------------------------------------------------------------------
diff --git a/3rdparty/stout/include/stout/os/windows/fd.hpp b/3rdparty/stout/include/stout/os/windows/fd.hpp
index 24d3661..b7aa92a 100644
--- a/3rdparty/stout/include/stout/os/windows/fd.hpp
+++ b/3rdparty/stout/include/stout/os/windows/fd.hpp
@@ -93,13 +93,13 @@ public:
 
   int crt() const
   {
-    CHECK_EQ(FD_CRT, type());
+    CHECK((type() == FD_CRT) || (type() == FD_HANDLE));
     return crt_;
   }
 
   operator HANDLE() const
   {
-    CHECK_EQ(FD_HANDLE, type());
+    CHECK((type() == FD_CRT) || (type() == FD_HANDLE));
     return handle_;
   }
 


[2/2] mesos git commit: Fixed a few typos in `os/windows/fd.hpp`.

Posted by mp...@apache.org.
Fixed a few typos in `os/windows/fd.hpp`.


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

Branch: refs/heads/master
Commit: 974581bdbb522e43ad07c6c78b6acb892d6c80a7
Parents: 7ff8cd4
Author: Michael Park <mp...@apache.org>
Authored: Mon Feb 6 16:18:39 2017 -0800
Committer: Michael Park <mp...@apache.org>
Committed: Mon Feb 6 17:42:12 2017 -0800

----------------------------------------------------------------------
 3rdparty/stout/include/stout/os/windows/fd.hpp | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/mesos/blob/974581bd/3rdparty/stout/include/stout/os/windows/fd.hpp
----------------------------------------------------------------------
diff --git a/3rdparty/stout/include/stout/os/windows/fd.hpp b/3rdparty/stout/include/stout/os/windows/fd.hpp
index b7aa92a..fddaaa5 100644
--- a/3rdparty/stout/include/stout/os/windows/fd.hpp
+++ b/3rdparty/stout/include/stout/os/windows/fd.hpp
@@ -68,7 +68,7 @@ public:
   // IMPORTANT: The `HANDLE` here is expected to be file handles. Specifically,
   //            `HANDLE`s returned by file API such as `CreateFile`. There are
   //            APIs that return `HANDLE`s with different error values, and
-  //            thereofre must be handled accordingly. For example, a thread API
+  //            therefore must be handled accordingly. For example, a thread API
   //            such as `CreateThread` returns `NULL` as the error value, rather
   //            than `INVALID_HANDLE_VALUE`.
   // TODO(mpark): Consider adding a second parameter which tells us what the
@@ -109,7 +109,7 @@ public:
     return socket_;
   }
 
-  // On Winodws, libevent's `evutil_socket_t` is set to `intptr_t`.
+  // On Windows, libevent's `evutil_socket_t` is set to `intptr_t`.
   operator intptr_t() const
   {
     CHECK_EQ(FD_SOCKET, type());
@@ -169,7 +169,7 @@ inline std::ostream& operator<<(std::ostream& stream, const WindowsFD& fd)
 inline bool operator<(const WindowsFD& left, const WindowsFD& right)
 {
   // In general, when compared against a `WindowsFD` in the `FD_CRT`, we map
-  // `INVALD_HANDLE_VALUE` and `INVALID_SOCKET` to `-1` before performing the
+  // `INVALID_HANDLE_VALUE` and `INVALID_SOCKET` to `-1` before performing the
   // comparison. The check for `< 0` followed by cast to `HANDLE` or `SOCKET` is
   // due to the fact that `HANDLE` and `SOCKET` are both unsigned.
   switch (left.type()) {
@@ -318,7 +318,7 @@ inline bool operator>=(const WindowsFD& left, int right)
 inline bool operator==(const WindowsFD& left, const WindowsFD& right)
 {
   // In general, when compared against a `WindowsFD` in the `FD_CRT`, we map
-  // `INVALD_HANDLE_VALUE` and `INVALID_SOCKET` to `-1` before performing the
+  // `INVALID_HANDLE_VALUE` and `INVALID_SOCKET` to `-1` before performing the
   // comparison. The check for `< 0` followed by cast to `HANDLE` or `SOCKET` is
   // due to the fact that `HANDLE` and `SOCKET` are both unsigned.
   switch (left.type()) {