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 -
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
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
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
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