mesos-reviews mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Bernd Mathiske <be...@mesosphere.io>
Subject Re: Review Request 39005: stout: Added thread-safe replacement for strerror.
Date Thu, 08 Oct 2015 09:49:37 GMT
Good call. Let’s change it!

> On Oct 7, 2015, at 11:14 PM, Benjamin Mahler <benjamin.mahler@gmail.com> wrote:
> 
> Seems like os::strerror() would be more consistent with our other posix api wrappers.
> 
> On Wed, Oct 7, 2015 at 9:27 AM, Bernd Mathiske <bernd@mesosphere.io <mailto:bernd@mesosphere.io>>
wrote:
> This is an automatically generated e-mail. To reply, visit: https://reviews.apache.org/r/39005/
<https://reviews.apache.org/r/39005/>
> 3rdparty/libprocess/3rdparty/stout/include/stout/error.hpp <https://reviews.apache.org/r/39005/diff/1/?file=1091859#file1091859line28>
(Diff revision 1)
> 27
>  * @note This function is thread-safe.
> Suggestion: "In contast to strerror(), this function is thread-safe."
> 
> 3rdparty/libprocess/3rdparty/stout/include/stout/error.hpp <https://reviews.apache.org/r/39005/diff/1/?file=1091859#file1091859line38>
(Diff revision 1)
> 37
>     buffer.resize(buffer.size() * 2, '\0');
> If you wanted to be really devensive, not trusting strerror_r() on all unforeseeable
platforms for all eternity, we could cut the loop at a max size.
> But then maybe we could just use a larger buffer to begin with and be done?
> Or, try 34 first and then something large like 1024, and that's it.
> 
> - Bernd Mathiske
> 
> 
> On October 6th, 2015, 8:07 a.m. PDT, Benjamin Bannier wrote:
> 
> Review request for mesos, Bernd Mathiske, Ben Mahler, and Till Toenshoff.
> By Benjamin Bannier.
> Updated Oct. 6, 2015, 8:07 a.m.
> 
> Bugs: MESOS-3551 <https://issues.apache.org/jira/browse/MESOS-3551>
> Repository: mesos
> Description
> 
> This adds a thread-safe wrapper around strerror_r which has semantics similar to strerror.
We plan to use this at call sites currently relying on strerror.
> Testing
> 
> make check
> Diffs
> 
> 3rdparty/libprocess/3rdparty/stout/include/stout/error.hpp (12ba1ca861114e60f8276c0ee91c543abcfc2519)
> 3rdparty/libprocess/3rdparty/stout/tests/error_tests.cpp (9e7605c53e6636e7fea32e4f69fbaff9100a979f)
> View Diff <https://reviews.apache.org/r/39005/diff/>


Mime
View raw message