Factor out pipe methods, add takeOwnershipOfPipes
authorAlexey Spiridonov <lesha@fb.com>
Fri, 8 May 2015 01:30:14 +0000 (18:30 -0700)
committerPraveen Kumar Ramakrishnan <praveenr@fb.com>
Tue, 12 May 2015 00:02:41 +0000 (17:02 -0700)
commit675a137da29d6c33f903d1ea9f58e5c1778c3770
tree59635f5711929b4b3c8832d20457d56fba2b4cd5
parentec3c8f790fc7e8d870d518211e124830c4bdf1d3
Factor out pipe methods, add takeOwnershipOfPipes

Summary:
In order to create an EventBase'd Suprocess class, I'd like to be able to manage the lifetime of pipes independently of the lifetime of the process. To this effect, I factored out basic Pipe handling, and provided a function that detaches the pipe vector from the Subprocess object.

#6996492 a push-blocking test is broken in trunk

Test Plan: added a unit test, fbconfig -r folly && fbmake runtests && fbmake runtests_opt

Reviewed By: dancol@fb.com

Subscribers: yfeldblum, chalfant, dancol, wez, anarayanan, trunkagent, net-systems@, njormrod, folly-diffs@

FB internal diff: D1699969

Signature: t1:1699969:1430975299:30d291ab7fcc555edddf098b33095a5b29500e76
folly/Subprocess.cpp
folly/Subprocess.h
folly/test/SubprocessTest.cpp