Re: [PATCH i-g-t 5/5] intel_gvtg_test: Handle system(3) return value.

Tvrtko Ursulin
2017-11-08T12:50:25Z

On 08/11/2017 12:19, Chris Wilson wrote:
> Quoting Tvrtko Ursulin (2017-11-08 12:06:54)
>> From: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
>>
>> Avoid the build warning by checking the pkill either did not find
>> any guests or managed to send a signal to all of them.
>>
>> Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
>> ---
>> tools/intel_gvtg_test.c | 4 +++-
>> 1 file changed, 3 insertions(+), 1 deletion(-)
>>
>> diff --git a/tools/intel_gvtg_test.c b/tools/intel_gvtg_test.c
>> index 7a29fbdde7cd..8c3d10cbd97f 100644
>> --- a/tools/intel_gvtg_test.c
>> +++ b/tools/intel_gvtg_test.c
>> @@ -144,7 +144,9 @@ static void create_guest(void)
>>
>> static void destroy_all_guest(void)
>> {
>> - system("pkill qemu");
>> + int ret = system("pkill qemu");
>> +
>> + igt_assert(ret == 0 || ret == 1);
>
> igt_terminate_process("qemu");
>
> Still wants the return checked.

Opted not to go for the helper because:

a) It would change the behaviour (exact match vs not) which I don't want
to go into.

b) igt_terminate_process looks inconsistent in return codes between its
two implementations.

Regards,

Tvrtko