You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@mesos.apache.org by Andrew Schwartzmeyer <an...@schwartzmeyer.com> on 2018/04/06 23:09:14 UTC
Re: Review Request 66455: Windows: Fixed `os::ftruncate()` to use
`FileEndOfFileInfo`.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/66455/
-----------------------------------------------------------
(Updated April 6, 2018, 4:09 p.m.)
Review request for mesos, Akash Gupta, Eric Mumau, John Kordich, Joseph Wu, and Michael Park.
Changes
-------
Use `FileEndOfFileInfo` instead of `SetEndOfFile()`.
Summary (updated)
-----------------
Windows: Fixed `os::ftruncate()` to use `FileEndOfFileInfo`.
Bugs: MESOS-8692
https://issues.apache.org/jira/browse/MESOS-8692
Repository: mesos
Description (updated)
-------
This previously used the CRT API `_chsize_s()`, which required a CRT
integer file descriptor. Instead, we can achieve the same behavior by
calling `SetFileInformationByHandle(FileEndOfFileInfo)`. This is
significantly easier than using `SetEndOfFile()`, as that requires (1)
saving the original position, (2) seeking to the new position, (3)
setting the end of the file at the new position, then (4) seeking back
to the original position. Instead, this method just sets the end of
the file directly based on the given `length`, much like `ftruncate()`
on POSIX systems.
Diffs (updated)
-----
3rdparty/stout/include/stout/os/windows/ftruncate.hpp fc4a8b5040d56fa9766687e44ce17fbe47d9e8f0
Diff: https://reviews.apache.org/r/66455/diff/2/
Changes: https://reviews.apache.org/r/66455/diff/1-2/
Testing
-------
Thanks,
Andrew Schwartzmeyer
Re: Review Request 66455: Windows: Fixed `os::ftruncate()` to use
`FileEndOfFileInfo`.
Posted by Akash Gupta <ak...@hotmail.com>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/66455/#review200752
-----------------------------------------------------------
Ship it!
Ship It!
- Akash Gupta
On April 6, 2018, 11:09 p.m., Andrew Schwartzmeyer wrote:
>
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/66455/
> -----------------------------------------------------------
>
> (Updated April 6, 2018, 11:09 p.m.)
>
>
> Review request for mesos, Akash Gupta, Eric Mumau, John Kordich, Joseph Wu, and Michael Park.
>
>
> Bugs: MESOS-8692
> https://issues.apache.org/jira/browse/MESOS-8692
>
>
> Repository: mesos
>
>
> Description
> -------
>
> This previously used the CRT API `_chsize_s()`, which required a CRT
> integer file descriptor. Instead, we can achieve the same behavior by
> calling `SetFileInformationByHandle(FileEndOfFileInfo)`. This is
> significantly easier than using `SetEndOfFile()`, as that requires (1)
> saving the original position, (2) seeking to the new position, (3)
> setting the end of the file at the new position, then (4) seeking back
> to the original position. Instead, this method just sets the end of
> the file directly based on the given `length`, much like `ftruncate()`
> on POSIX systems.
>
>
> Diffs
> -----
>
> 3rdparty/stout/include/stout/os/windows/ftruncate.hpp fc4a8b5040d56fa9766687e44ce17fbe47d9e8f0
>
>
> Diff: https://reviews.apache.org/r/66455/diff/2/
>
>
> Testing
> -------
>
>
> Thanks,
>
> Andrew Schwartzmeyer
>
>
Re: Review Request 66455: Windows: Fixed `os::ftruncate()` to use
`FileEndOfFileInfo`.
Posted by Joseph Wu <jo...@mesosphere.io>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/66455/#review201258
-----------------------------------------------------------
Ship it!
- Joseph Wu
On April 6, 2018, 4:09 p.m., Andrew Schwartzmeyer wrote:
>
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/66455/
> -----------------------------------------------------------
>
> (Updated April 6, 2018, 4:09 p.m.)
>
>
> Review request for mesos, Akash Gupta, Eric Mumau, John Kordich, Joseph Wu, and Michael Park.
>
>
> Bugs: MESOS-8692
> https://issues.apache.org/jira/browse/MESOS-8692
>
>
> Repository: mesos
>
>
> Description
> -------
>
> This previously used the CRT API `_chsize_s()`, which required a CRT
> integer file descriptor. Instead, we can achieve the same behavior by
> calling `SetFileInformationByHandle(FileEndOfFileInfo)`. This is
> significantly easier than using `SetEndOfFile()`, as that requires (1)
> saving the original position, (2) seeking to the new position, (3)
> setting the end of the file at the new position, then (4) seeking back
> to the original position. Instead, this method just sets the end of
> the file directly based on the given `length`, much like `ftruncate()`
> on POSIX systems.
>
>
> Diffs
> -----
>
> 3rdparty/stout/include/stout/os/windows/ftruncate.hpp fc4a8b5040d56fa9766687e44ce17fbe47d9e8f0
>
>
> Diff: https://reviews.apache.org/r/66455/diff/2/
>
>
> Testing
> -------
>
>
> Thanks,
>
> Andrew Schwartzmeyer
>
>