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 <[email protected]> wrote: > This is an automatically generated e-mail. To reply, visit: > 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/> >
