On 04/21/2016 04:04 AM, Sascha Silbe wrote:
Dear Cole,
Cole Robinson <crobinso(a)redhat.com> writes:
[tests/testutils.c:virTestRewrapFile()]
> + /* The 'echo' syntax lets us read and write the file in one shot */
> + if (virAsprintf(&cmd, "echo \"$(%s/test-wrap-argv.pl %s)\"
> %s",
> + abs_srcdir, filename, filename) < 0)
> + return -1;
[...]
> + return system(cmd);
Doesn't the shell truncate the file before test-wrap-argv.pl gets a
chance to read the original content?
That's what the echo syntax works around; the test-wrap-argv command is fully
run before the output file is truncated
But I've dropped this patch anyways
- Cole