All paludis clients hang during metadate generation on Exherbo when option{,q} called in global scope

Description

Pretty much exactly what it says on the tin. The exact way it happens is that:

Cave spawns the metadata generation job, then uses waitpid to wait for it to finish.

The metadata generation job then spawns a child, and waits for standard output from it.

Repeat twice.

The last of these children (call it 'foo') spawns another child. The child now spawns and calls waitpid on its child, and *that* child launches locked_pipe_command and connects its standard output to 'foo'. 'foo' then blocks on reading locked_pipe_command's output.

Up to here everything has been going normally. What then goes wrong is that whatever process is supposed to be feeding input to locked_pipe_command stops doing so, but does not send EOF. Thus, locked_pipe_command blocks forever in __read_nocancel, and cave's progress halts.