docker/libcontainer — pull request #170 by bernerdschaefer (2014-08-29 14:39:40+00:00)
Title: syncpipe: consume from parent before closing child

Previously, closing the child side of the syncpipe (after fork) before reading from the parent would cause the parent to receive ECONNRESET. This meant that if `ReportChildError` was before `ReadFromParent`, the error would not be propagated to the parent.

Now `CloseChild` will always (attempt) to consume parent data before shutting down the child side.

The tests have been updated to mimic the behaviors of nsinit/namespaces interactions, and without the code changes will fail with ECONNRESET errors.