utils.c: run_child redirect stderr to stdout
PATCH 1/2 utils.c: run_child redirect stderr to stdout
To fix buffer ordering problems.
Signed-off-by Aníbal Limón <[email protected]>
--- utils.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
utils.c +2 -1
@@ -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 );
Signature · 1 line
2.20.1
PATCH 2/2 utils.c: Print DURATION after ERROR
If a process gets killed by timeout or OOM the output could end without '\n' so add 'DURATION: N\n' after '\nERROR: ptest-dir\n'.
Signed-off-by Aníbal Limón <[email protected]>
--- utils.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
utils.c +1 -1
@@ -382,12 +382,12 @@ run_ptests(struct ptest_list *head, const struct ptest_options opts, opts.timeout, fds, fps, &timeouted); entime =time (NULL ); duration = entime - sttime; -fprintf (fps[0 ],"DURATION: %d\n" , duration);if (status) {fprintf (fps[0 ],"\nERROR: Exit status is %d\n" , status); rc +=1 ; } +fprintf (fps[0 ],"DURATION: %d\n" , duration);if (timeouted)fprintf (fps[0 ],"TIMEOUT: %s\n" , ptest_dir);
Signature · 1 line
2.20.1