joyent/node — pull request #2944 by AvianFlu (2012-03-15 16:18:16+00:00)
Title: child_process: Add 'close' event for child processes

This patch changes the exit semantics of child processes so that two events are now emitted - `exit` and `close` - instead of just `exit`.

- `exit`: The `exit` event is now fired when the spawned child process exits, regardless of the state of its stdio streams. The existing behavior was to wait for `close` events from all stdio streams before emitting `exit`, which would create various complex situations with inherited stdio handles. (see #2914)
- `close`: A new `close` event is now fired in place of the old `exit` event, i.e. when `close` events have been received from all stdio streams.