[ptest-runner,1/2] utils.c: run_child redirect stderr to stdout

Submitted by Aníbal Limón on Jan. 30, 2019, 5:07 p.m. | Patch ID: 158392

Details

Message ID 20190130170737.5347-1-anibal.limon@linaro.org
State New
Headers show

Commit Message

Aníbal Limón Jan. 30, 2019, 5:07 p.m.
To fix buffer ordering problems.

Signed-off-by: Aníbal Limón <anibal.limon@linaro.org>
---
 utils.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

Patch hide | download patch | download mbox

diff --git a/utils.c b/utils.c
index 01ee415..0813e3c 100644
--- a/utils.c
+++ b/utils.c
@@ -250,7 +250,8 @@  run_child(char *run_ptest, int fd_stdout, int fd_stderr)
 	argv[1] = NULL;
 
 	dup2(fd_stdout, STDOUT_FILENO);
-	dup2(fd_stderr, STDERR_FILENO);
+	// XXX: Redirect stderr to stdout to avoid buffer ordering problems.
+	dup2(fd_stdout, STDERR_FILENO);
 	execv(run_ptest, argv);
 
 	exit(1);