You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@mesos.apache.org by Joris Van Remoortere <jo...@gmail.com> on 2015/12/10 05:12:54 UTC
Re: Review Request 39584: Windows: Implemented `os::rmdir.hpp`.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/39584/#review109681
-----------------------------------------------------------
3rdparty/libprocess/3rdparty/stout/include/stout/os/posix/rmdir.hpp (lines 1 - 13)
<https://reviews.apache.org/r/39584/#comment169276>
header format change.
3rdparty/libprocess/3rdparty/stout/include/stout/os/posix/rmdir.hpp (line 18)
<https://reviews.apache.org/r/39584/#comment169278>
`#include <unistd.h>`
`#include <string>`
`#include <stout/error.hpp>`
3rdparty/libprocess/3rdparty/stout/include/stout/os/rmdir.hpp (lines 1 - 13)
<https://reviews.apache.org/r/39584/#comment169275>
header format change.
3rdparty/libprocess/3rdparty/stout/include/stout/os/windows/rmdir.hpp (lines 1 - 13)
<https://reviews.apache.org/r/39584/#comment169277>
header format change.
3rdparty/libprocess/3rdparty/stout/include/stout/os/windows/rmdir.hpp (lines 53 - 54)
<https://reviews.apache.org/r/39584/#comment169279>
indentation.
3rdparty/libprocess/3rdparty/stout/include/stout/os/windows/rmdir.hpp (line 58)
<https://reviews.apache.org/r/39584/#comment169280>
`because folder guaranteed`
can you fix the grammar here?
3rdparty/libprocess/3rdparty/stout/include/stout/os/windows/rmdir.hpp (lines 79 - 80)
<https://reviews.apache.org/r/39584/#comment169281>
indentation
3rdparty/libprocess/3rdparty/stout/include/stout/os/windows/rmdir.hpp (lines 90 - 91)
<https://reviews.apache.org/r/39584/#comment169282>
indentation.
3rdparty/libprocess/3rdparty/stout/include/stout/os/windows/rmdir.hpp (lines 93 - 94)
<https://reviews.apache.org/r/39584/#comment169283>
let's keep the else on the same line as the previous closing brace.
3rdparty/libprocess/3rdparty/stout/include/stout/os/windows/rmdir.hpp (lines 100 - 101)
<https://reviews.apache.org/r/39584/#comment169284>
indentation.
3rdparty/libprocess/3rdparty/stout/include/stout/os/windows/rmdir.hpp (line 109)
<https://reviews.apache.org/r/39584/#comment169286>
Can you explain / comment why here (as well as on L139) we use `ErrnoError`, yet elsewhere we use `WindowsError`?
3rdparty/libprocess/3rdparty/stout/include/stout/os/windows/rmdir.hpp (lines 110 - 111)
<https://reviews.apache.org/r/39584/#comment169285>
indentation.
3rdparty/libprocess/3rdparty/stout/include/stout/os/windows/rmdir.hpp (lines 133 - 134)
<https://reviews.apache.org/r/39584/#comment169287>
indentation.
- Joris Van Remoortere
On Nov. 16, 2015, 9:13 a.m., Alex Clemmer wrote:
>
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/39584/
> -----------------------------------------------------------
>
> (Updated Nov. 16, 2015, 9:13 a.m.)
>
>
> Review request for mesos, Artem Harutyunyan, Joris Van Remoortere, and Joseph Wu.
>
>
> Repository: mesos
>
>
> Description
> -------
>
> Windows: Implemented `os::rmdir.hpp`.
>
>
> Diffs
> -----
>
> 3rdparty/libprocess/3rdparty/stout/include/Makefile.am a8c35c086ecae21701f6a720f25231c1b0d4e329
> 3rdparty/libprocess/3rdparty/stout/include/stout/os.hpp 5c1df81193b4b888d2ed5c7dbfa0b5e2fae48467
> 3rdparty/libprocess/3rdparty/stout/include/stout/os/posix/rmdir.hpp PRE-CREATION
> 3rdparty/libprocess/3rdparty/stout/include/stout/os/rmdir.hpp PRE-CREATION
> 3rdparty/libprocess/3rdparty/stout/include/stout/os/windows/rmdir.hpp PRE-CREATION
> 3rdparty/libprocess/3rdparty/stout/include/stout/posix/os.hpp e26df59d9b837e1f4a4b92577f0a3de4b9076cb4
> 3rdparty/libprocess/3rdparty/stout/include/stout/windows/os.hpp edf17d5ad8efbc988e909bfb8ffa5a015ecdc89d
>
> Diff: https://reviews.apache.org/r/39584/diff/
>
>
> Testing
> -------
>
> `make check` from autotools on Ubuntu 15.
> `make check` from CMake on OS X 10.10.
> Ran `check` project in VS on Windows 10.
>
>
> Thanks,
>
> Alex Clemmer
>
>
Re: Review Request 39584: Windows: Implemented `os::rmdir.hpp`.
Posted by Alex Clemmer <cl...@gmail.com>.
> On Dec. 10, 2015, 4:12 a.m., Joris Van Remoortere wrote:
> > 3rdparty/libprocess/3rdparty/stout/include/stout/os/windows/rmdir.hpp, line 109
> > <https://reviews.apache.org/r/39584/diff/7/?file=1125983#file1125983line109>
> >
> > Can you explain / comment why here (as well as on L139) we use `ErrnoError`, yet elsewhere we use `WindowsError`?
`errno` captures errors that have happened in the C standard library, and `ErrnoError` captures those errors and their messages and lifts them into an `Error` type.
For Windows API functions (which, of course, are not a part of the C standard library) have their own `errno`-like error reporting mechanism, called `GetLastError()`. `WindowsError` captures these errors and lifts them into an `Error` type.
Thus, when we call Windows API functions, we capture errors with `WindowsError`, and when we call C standard library functions, we capture errors with `ErrnoError`.
Does that make sense?
- Alex
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/39584/#review109681
-----------------------------------------------------------
On Nov. 16, 2015, 9:13 a.m., Alex Clemmer wrote:
>
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/39584/
> -----------------------------------------------------------
>
> (Updated Nov. 16, 2015, 9:13 a.m.)
>
>
> Review request for mesos, Artem Harutyunyan, Joris Van Remoortere, and Joseph Wu.
>
>
> Repository: mesos
>
>
> Description
> -------
>
> Windows: Implemented `os::rmdir.hpp`.
>
>
> Diffs
> -----
>
> 3rdparty/libprocess/3rdparty/stout/include/Makefile.am a8c35c086ecae21701f6a720f25231c1b0d4e329
> 3rdparty/libprocess/3rdparty/stout/include/stout/os.hpp 5c1df81193b4b888d2ed5c7dbfa0b5e2fae48467
> 3rdparty/libprocess/3rdparty/stout/include/stout/os/posix/rmdir.hpp PRE-CREATION
> 3rdparty/libprocess/3rdparty/stout/include/stout/os/rmdir.hpp PRE-CREATION
> 3rdparty/libprocess/3rdparty/stout/include/stout/os/windows/rmdir.hpp PRE-CREATION
> 3rdparty/libprocess/3rdparty/stout/include/stout/posix/os.hpp e26df59d9b837e1f4a4b92577f0a3de4b9076cb4
> 3rdparty/libprocess/3rdparty/stout/include/stout/windows/os.hpp edf17d5ad8efbc988e909bfb8ffa5a015ecdc89d
>
> Diff: https://reviews.apache.org/r/39584/diff/
>
>
> Testing
> -------
>
> `make check` from autotools on Ubuntu 15.
> `make check` from CMake on OS X 10.10.
> Ran `check` project in VS on Windows 10.
>
>
> Thanks,
>
> Alex Clemmer
>
>
Re: Review Request 39584: Windows: Implemented `os::rmdir.hpp`.
Posted by Alex Clemmer <cl...@gmail.com>.
> On Dec. 10, 2015, 4:12 a.m., Joris Van Remoortere wrote:
> > 3rdparty/libprocess/3rdparty/stout/include/stout/os/windows/rmdir.hpp, line 109
> > <https://reviews.apache.org/r/39584/diff/7/?file=1125983#file1125983line109>
> >
> > Can you explain / comment why here (as well as on L139) we use `ErrnoError`, yet elsewhere we use `WindowsError`?
>
> Alex Clemmer wrote:
> `errno` captures errors that have happened in the C standard library, and `ErrnoError` captures those errors and their messages and lifts them into an `Error` type.
>
> For Windows API functions (which, of course, are not a part of the C standard library) have their own `errno`-like error reporting mechanism, called `GetLastError()`. `WindowsError` captures these errors and lifts them into an `Error` type.
>
> Thus, when we call Windows API functions, we capture errors with `WindowsError`, and when we call C standard library functions, we capture errors with `ErrnoError`.
>
> Does that make sense?
As far as comments go, this is commented in the `WindowsError` code itself. It seems impractical to add this comment at every call site, but maybe you meant something else?
- Alex
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/39584/#review109681
-----------------------------------------------------------
On Jan. 4, 2016, 12:02 p.m., Alex Clemmer wrote:
>
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/39584/
> -----------------------------------------------------------
>
> (Updated Jan. 4, 2016, 12:02 p.m.)
>
>
> Review request for mesos, Artem Harutyunyan, Joris Van Remoortere, and Joseph Wu.
>
>
> Repository: mesos
>
>
> Description
> -------
>
> Windows: Implemented `os::rmdir.hpp`.
>
>
> Diffs
> -----
>
> 3rdparty/libprocess/3rdparty/stout/include/Makefile.am b2dea9b93adfa3ea0415a0b5c81a369dd29b6cfe
> 3rdparty/libprocess/3rdparty/stout/include/stout/os.hpp 14fbca6d222bdfc0e8be301050b4ea1a8a6e7758
> 3rdparty/libprocess/3rdparty/stout/include/stout/os/posix/rmdir.hpp PRE-CREATION
> 3rdparty/libprocess/3rdparty/stout/include/stout/os/rmdir.hpp PRE-CREATION
> 3rdparty/libprocess/3rdparty/stout/include/stout/os/windows/rmdir.hpp PRE-CREATION
> 3rdparty/libprocess/3rdparty/stout/include/stout/posix/os.hpp 4cf693fb7e8c6bb3ad1920ebe90d61f0adb5dc99
> 3rdparty/libprocess/3rdparty/stout/include/stout/windows/os.hpp e738cdbf5846950c475c159fb9a770acc45159f5
>
> Diff: https://reviews.apache.org/r/39584/diff/
>
>
> Testing
> -------
>
> `make check` from autotools on Ubuntu 15.
> `make check` from CMake on OS X 10.10.
> Ran `check` project in VS on Windows 10.
>
>
> Thanks,
>
> Alex Clemmer
>
>