Fixed ignoring of ctrl-c.

Found out that if I send the signal directly to the crosperf process
by "kill -SIGING <pid>", crosperf handles it correctly.
However, the ctrl-c from the keyboard did not work. I started tracing it
and found out that crosperf shares the stdin with the children process.
If I avoid this sharing of stdin everything works fine. I assume one of
the commands executed is modifying some settings in the terminal and
changes the keyboard mapping for SIGINT.

To fix it, when invoking popen, request the creating of a pipe to
be used as the stdin for the new process. Once popen returns close this
pipe to avoid having the child process blocked on this pipe.

BUG=chromium:492826
TEST=Ran a few tests in crosperf. Verified the ctrl-c now works.

Change-Id: I767054a6f9e43a5137a98e074515b41db9a222ab
Reviewed-on: https://chrome-internal-review.googlesource.com/232011
Commit-Ready: Luis Lozano <llozano@chromium.org>
Tested-by: Luis Lozano <llozano@chromium.org>
Reviewed-by: Luis Lozano <llozano@chromium.org>
1 file changed