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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, Nov 08, 2017 at 12:06:54PM +0000, Tvrtko Ursulin wrote:
> From: Tvrtko Ursulin <tvrtko.ursulin@xxxxxxxxx>
> 
> 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@xxxxxxxxx>
> ---
>  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);


system() returns a wait status and you need to inspect it with
WEXITSTATUS(ret).


-- 
Petri Latvala




>  }
>  
>  static void remove_vgpu(void)
> -- 
> 2.14.1
> 
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx@xxxxxxxxxxxxxxxxxxxxx
> https://lists.freedesktop.org/mailman/listinfo/intel-gfx
_______________________________________________
Intel-gfx mailing list
Intel-gfx@xxxxxxxxxxxxxxxxxxxxx
https://lists.freedesktop.org/mailman/listinfo/intel-gfx




[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]
  Powered by Linux