On Mon, Aug 20, 2018 at 10:38 AM, Nathan Sidwell <nat...@acm.org> wrote: > > This is the first of a pair of patches I've had on the modules branch for a > while. They improve the error behaviour in the case of child failure when > vfork is the forking mechanism. > > This one commonizes the error paths in the parent and child to a pair of > single blocks that print or return the error respectively. Currently each > error case calls pex_child_error, or returns the error in the parent. > > The patch records the name of a failing system call, and uses that to print > or return the error. It doesn't change functionality but will simplify the > next patch that does. > > booted on x86_64-linux (which uses vfork), ok?
+ if (!bad_fn && in != STDIN_FILE_NO && close (in) < 0) + bad_fn = "close"; As a matter of style I don't personally like the pattern in which a condition has both tests and actions. It's too easy to miss the action. I would prefer to see this more like the original code: if (!bad_fn && in != STDIN_FILE_NO) { if (close(in) < 0) bad_fn = "close"; } This is OK with those changes. Thanks. Ian