----------------------------------------------------------- This is an automatically generated e-mail. To reply, visit: https://reviews.apache.org/r/19259/#review39464 -----------------------------------------------------------
I think we can simplify by just having the forked child use '_exit' if 'setup' fails. Check out the comments below. Great! 3rdparty/libprocess/src/subprocess.cpp <https://reviews.apache.org/r/19259/#comment71855> Can we comment that we're doing this before we fork because it might not be async-signal safe? Also, how about we simplify this back to as it was before and just do: internal::Envp envp(environment.get(map<string, string>())); 3rdparty/libprocess/src/subprocess.cpp <https://reviews.apache.org/r/19259/#comment71853> IIUC, an '_exit' should be sufficient for non-zero return codes, should clean this up too: if (setup.isSome()) { int status = setup.get()(); if (status != 0) { _exit(status); } } - Benjamin Hindman On April 3, 2014, 7:23 p.m., Till Toenshoff wrote: > > ----------------------------------------------------------- > This is an automatically generated e-mail. To reply, visit: > https://reviews.apache.org/r/19259/ > ----------------------------------------------------------- > > (Updated April 3, 2014, 7:23 p.m.) > > > Review request for mesos, Benjamin Hindman, Dominic Hamon, and Ian Downes. > > > Bugs: MESOS-1102 > https://issues.apache.org/jira/browse/MESOS-1102 > > > Repository: mesos-git > > > Description > ------- > > Adds the ability to process::subprocess to run a function (lambda) within the > child context, after fork and before exec. > > NOTE: Such lambda must not contain any async unsafe code. For details on > async safety, see POSIX.1-2004 on async-signal-safe functions, also > referenced in the signal man-pages: > http://man7.org/linux/man-pages/man7/signal.7.html. > > > Diffs > ----- > > 3rdparty/libprocess/include/process/subprocess.hpp 6c51c0b > 3rdparty/libprocess/src/subprocess.cpp e09c808 > 3rdparty/libprocess/src/tests/subprocess_tests.cpp 9413ecc > > Diff: https://reviews.apache.org/r/19259/diff/ > > > Testing > ------- > > make check > > > Thanks, > > Till Toenshoff > >
