Re: [LTP] [PATCH 1/2 V2] tst_run_cmd: added support for stdout and stderr redirection

2013-08-05 Thread chrubis
Hi! What about passing file descriptors to function (-1 means no redirection) and create a second function on the top of it that opens the files, does the checks and the calls the tst_run_cmd? So you propose creating two functions: one will accept (const char *) arguments, the other -

Re: [LTP] [PATCH 1/2 V2] tst_run_cmd: added support for stdout and stderr redirection

2013-08-05 Thread Stanislav Kholmanskikh
On 08/05/2013 03:33 PM, chru...@suse.cz wrote: Hi! What about passing file descriptors to function (-1 means no redirection) and create a second function on the top of it that opens the files, does the checks and the calls the tst_run_cmd? So you propose creating two functions: one will

Re: [LTP] [PATCH 1/2 V2] tst_run_cmd: added support for stdout and stderr redirection

2013-08-02 Thread Stanislav Kholmanskikh
Hi! Hi, Cyril. -if (!pid) +if (!pid) { +/* redirecting stdout and stderr if needed */ +if (stdout_path != NULL) { +child_stdout = open(stdout_path, +OPEN_FLAGS, OPEN_MODE); + +if

[LTP] [PATCH 1/2 V2] tst_run_cmd: added support for stdout and stderr redirection

2013-08-01 Thread Stanislav Kholmanskikh
From: Stanislav kholmanskikh stanislav.kholmansk...@oracle.com Signed-off-by: Stanislav kholmanskikh stanislav.kholmansk...@oracle.com --- include/test.h|9 - lib/tst_run_cmd.c | 50 -- 2 files changed, 56 insertions(+), 3

Re: [LTP] [PATCH 1/2 V2] tst_run_cmd: added support for stdout and stderr redirection

2013-08-01 Thread chrubis
Hi! - if (!pid) + if (!pid) { + /* redirecting stdout and stderr if needed */ + if (stdout_path != NULL) { + child_stdout = open(stdout_path, + OPEN_FLAGS, OPEN_MODE); + + if