fdio_transfer_fd() has two failure modes with (currently) differing behaviours:
1. The internal unwrap() operation fails. In this case the call fails and the descriptor is closed.
2. The descriptor shares the description with another descriptor, via dup(), preventing it from being transferred. In this case the call fails but the descriptor remains valid.
We don't handle these failure-modes correctly everywhere. The API itself should be made more consistent, e.g. by at least having a specific return code to look for to distinguish the failure cases.
Comment 1 by w...@chromium.org
, Aug 1