From: chrubis@suse.cz
To: Stanislav Kholmanskikh <stanislav.kholmanskikh@oracle.com>
Cc: vasily.isaenko@oracle.com, ltp-list@lists.sourceforge.net,
alexey.kodanev@oracle.com
Subject: Re: [LTP] [PATCH 1/2 V2] tst_run_cmd: added support for stdout and stderr redirection
Date: Mon, 5 Aug 2013 13:33:19 +0200 [thread overview]
Message-ID: <20130805113319.GA8739@rei> (raw)
In-Reply-To: <51FB6D7F.3080507@oracle.com>
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 - file descriptors. Yes?
I preffer to look at this as creating one bare function to do the work
(redirect, vfork + exec) and creating the final function on the top of
it.
Good thing about the desing is that we can keep the bare function very
simple.
> But do we really need this functionality in LTP (ie redirect cmd output
> either to filename or to file descriptor)?
Well, it may be usefull to be able to redirect stdout of a command into
a pipe for example.
> What about modifying tst_run_cmd interface as I propose:
> tst_run_cmd_redirected(void (cleanup_fn)(void),
> char *const argv[],
> const char *stdout_path,
> const char *stderr_path)
> but putting all the related to file descriptors' opening/closing in
> parent's body.
That works as well.
--
Cyril Hrubis
chrubis@suse.cz
------------------------------------------------------------------------------
Get your SQL database under version control now!
Version control is standard for application code, but databases havent
caught up. So what steps can you take to put your SQL databases under
version control? Why should you start doing it? Read more to find out.
http://pubads.g.doubleclick.net/gampad/clk?id=49501711&iu=/4140/ostg.clktrk
_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list
prev parent reply other threads:[~2013-08-05 11:33 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-07-19 9:26 [LTP] [PATCH 1/2] tst_run_cmd: added support for stdout and stderr redirection Stanislav Kholmanskikh
2013-07-19 9:26 ` [LTP] [PATCH 2/2] lib/tst_module.c: modification for updated tst_run_cmd specification Stanislav Kholmanskikh
2013-07-31 14:19 ` [LTP] [PATCH 1/2] tst_run_cmd: added support for stdout and stderr redirection chrubis
2013-08-01 13:08 ` [LTP] [PATCH 1/2 V2] " Stanislav Kholmanskikh
2013-08-01 16:04 ` chrubis
[not found] ` <51FB6D7F.3080507@oracle.com>
2013-08-05 11:33 ` chrubis [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20130805113319.GA8739@rei \
--to=chrubis@suse.cz \
--cc=alexey.kodanev@oracle.com \
--cc=ltp-list@lists.sourceforge.net \
--cc=stanislav.kholmanskikh@oracle.com \
--cc=vasily.isaenko@oracle.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox