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 (child_stdout == -1) {
> + tst_resm(TWARN | TERRNO,
> + "open() on %s failed at %s:%d: %s",
> + stdout_path, __FILE__, __LINE__,
> + strerror(errno));
You should not call the tst_resm() here for two reasons.
1. It is not designed to be called from a child of the main test process
2. It still may corrupt the parent memory although in this case it's
not that likely (as it operates on FILE* used for the test output,
note that ANY operation on FILE* may get it into inconsistent state
in the parent later)
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?
--
Cyril Hrubis
[email protected]
------------------------------------------------------------------------------
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