diff options
author | Jeff King <peff@peff.net> | 2015-03-23 06:54:05 +0300 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2015-03-23 07:39:22 +0300 |
commit | c29b3962af3df80a43fab4ead4875bd2ca275e4c (patch) | |
tree | c78c409f1fde1425843d2b53bfc58d14be589274 /wt-status.c | |
parent | c5eadcaab1d3969a4fbc009c65be622271edddd9 (diff) |
run-command: forbid using run_command with piped output
Because run_command both spawns and wait()s for the command
before returning control to the caller, any reads from the
pipes we open must necessarily happen after wait() returns.
This can lead to deadlock, as the child process may block
on writing to us while we are blocked waiting for it to
exit.
Worse, it only happens when the child fills the pipe
buffer, which means that the problem may come and go
depending on the platform and the size of the output
produced by the child.
Let's detect and flag this dangerous construct so that we
can catch potential bugs early in the test suite rather than
having them happen in the field.
Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'wt-status.c')
0 files changed, 0 insertions, 0 deletions