On 08/05/2013 03:33 PM, [email protected] 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 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.
Ok, I'will rewrite as you propose.


>
>> 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.
>
Thank you.


------------------------------------------------------------------------------
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
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list

Reply via email to