-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/46928/
-----------------------------------------------------------
(Updated May 10, 2016, 8:15 a.m.)
Review request for mesos, Daniel Pravat, Artem Harutyunyan, Joris Van
Remoortere, and Michael Park.
Bugs: MESOS-5318
https://issues.apache.org/jira/browse/MESOS-5318
Repository: mesos
Description
-------
This commit has three goals:
(1) Expand the `os::close` to support closing Windows `HANDLE`
objects. This will simplify code in many places, but most notably
(and immediately) subprocess, where sharing code between POSIX and
Windows implementations is a major priority.
(2) Make `os::close` safe on Windows. Unlike its POSIX cousins, the
Windows implementation of `::close` is very picky about which file
descriptors it will close. If you pass it a `SOCKET` by mistake,
for example, the C runtime will throw a structured exception.
Since this could potentially halt the process, and since our core
socket abstractions (socket.hpp, for example) use `int` to
represent sockets, it is worth investing in safety here.
(3) Add `os::close` unit tests to verify the safety requirements.
Diffs (updated)
-----
3rdparty/libprocess/3rdparty/stout/include/stout/os/windows/close.hpp
8f7318aecff261b803991f7aa24ad869de8c1162
3rdparty/libprocess/3rdparty/stout/tests/main.cpp
3f3f62769abdbe44b3e37e0ea9e5f59484b52db6
3rdparty/libprocess/3rdparty/stout/tests/os/filesystem_tests.cpp
269079f316b51e19990d3058c1b9a34060e3559b
Diff: https://reviews.apache.org/r/46928/diff/
Testing
-------
Thanks,
Alex Clemmer