[libvirt] [PATCH] tests: Use system() for test-wrap-argv.pl

Cole Robinson crobinso at redhat.com
Thu Apr 21 13:33:18 UTC 2016


On 04/21/2016 04:04 AM, Sascha Silbe wrote:
> Dear Cole,
> 
> Cole Robinson <crobinso at 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




More information about the libvir-list mailing list