rework the Subprocess::communicate() API
Summary:
This eliminates the CommunicateFlags argument to communicate(). It now
always reads from both stdout and stderr if they were set up a pipes.
If a non-empty input buffer was supplied, it always writes that to
stdin.
This mimics the communicate() behavior of python's subprocess.py module.
This also makes it impossible to have buffering deadlocks by forgetting
to call communicate() with readStderr().
Test Plan:
Ran the existing subprocess tests, and also added a more complicated
duplex test that requires communication on stdin, stdout, and stderr all
at the same time.
Also grepped for all existing users of Subprocess::communicate(), and
made sure they will work correctly with the new behavior.
Reviewed By: tudorb@fb.com
FB internal diff:
D814405