> On July 11, 2013, 5:48 p.m., Ben Mahler wrote: > > 3rdparty/libprocess/3rdparty/stout/include/stout/os/osx.hpp, line 43 > > <https://reviews.apache.org/r/12430/diff/1/?file=319784#file319784line43> > > > > s/priveledge/privilege/
Thanks Ben. ;) > On July 11, 2013, 5:48 p.m., Ben Mahler wrote: > > 3rdparty/libprocess/3rdparty/stout/include/stout/os/osx.hpp, line 53 > > <https://reviews.apache.org/r/12430/diff/1/?file=319784#file319784line53> > > > > Any pointers for this? I found a few posts and the like that seemed to > > show the pseudo-struct that gets returned, perhaps document that? I added a link and some more comments. > On July 11, 2013, 5:48 p.m., Ben Mahler wrote: > > 3rdparty/libprocess/3rdparty/stout/include/stout/os/osx.hpp, lines 58-64 > > <https://reviews.apache.org/r/12430/diff/1/?file=319784#file319784line58> > > > > This took me a bit to understand, maybe something like the following > > would be simpler to follow: > > > > std::vector<std::string> tokens = > > strings::tokenize(args.get(), std::string(1, '\0')); > > > > if (argc == 1) { > > // When there are no arguments, all we care about is > > // the executable path. > > s = tokens[0]; > > } else if (argc > 1) { > > // When there are arguments, we grab arg[0..n] > > // assuming arg0 is the canonical executable name. > > tokens.erase(tokens.front()); // Remove path. > > s = strings::join(" ", tokens); > > } > > > > command = s; > > > > Also, what about the argc == 0 case? Should that be an error? Should > > there be an error when tokens.size() != argc? > > > > What do you think? Awesome idea! I cleaned it up. If argc == 0 then 'command' will just be none, likewise, if we get no tokens out of 'tokens.erase(tokens.begin() + argc, tokens.end())' (see the code) then 'command' will just stay none. Thanks Ben! - Benjamin ----------------------------------------------------------- This is an automatically generated e-mail. To reply, visit: https://reviews.apache.org/r/12430/#review23020 ----------------------------------------------------------- On July 12, 2013, 1:23 a.m., Benjamin Hindman wrote: > > ----------------------------------------------------------- > This is an automatically generated e-mail. To reply, visit: > https://reviews.apache.org/r/12430/ > ----------------------------------------------------------- > > (Updated July 12, 2013, 1:23 a.m.) > > > Review request for mesos and Ben Mahler. > > > Repository: mesos > > > Description > ------- > > See summary. > > > Diffs > ----- > > 3rdparty/libprocess/3rdparty/stout/include/stout/os/osx.hpp > e8429b997cdefd703ef16249789750fe7d8ac9c4 > 3rdparty/libprocess/3rdparty/stout/tests/strings_tests.cpp > 7ec94468df3d447a0c30ad9c82fa4c2fe91deb7e > > Diff: https://reviews.apache.org/r/12430/diff/ > > > Testing > ------- > > make check > > > Thanks, > > Benjamin Hindman > >
