()
| 254 | var fds = 0; |
| 255 | // exits process when stdout (1) and sdterr(2) are both drained. |
| 256 | function tryToExit() { |
| 257 | if ((fds & 1) && (fds & 2)) { |
| 258 | debug('This command took %ds to execute', (new Date() - that.start_timer) / 1000); |
| 259 | process.exit(code); |
| 260 | } |
| 261 | } |
| 262 | |
| 263 | [process.stdout, process.stderr].forEach(function(std) { |
| 264 | var fd = std.fd; |