[PATCH v2 2/2] ioctl console test v2

Dmitry V. Levin ldv at altlinux.org
Mon Mar 9 12:41:25 UTC 2020


On Mon, Mar 09, 2020 at 05:55:52PM +0530, archsbran wrote:
> From: Bran S <archsbran at gmail.com>
> 
> ---
>  tests/ioctl_console.c | 5 ++---
>  1 file changed, 2 insertions(+), 3 deletions(-)

First of all, there is no need to submit incremental patches,
just send a revised edition.

> diff --git a/tests/ioctl_console.c b/tests/ioctl_console.c
> index af7f1182..69054e9a 100644
> --- a/tests/ioctl_console.c
> +++ b/tests/ioctl_console.c
> @@ -5,7 +5,6 @@
>   * SPDX-License-Identifier: GPL-2.0-or-later
>   */
>  
> -// #include "tests.h"

All tests should include this header file unless they have a strong reason
not to include it.

>  #include <stdio.h>
>  #include <string.h>
> @@ -19,13 +18,13 @@ int
>  main(void)
>  {
>  	char c_status;
> -	unsigned long int ul_status;
> +	unsigned long int ul_status = 0;
>  
>  	ioctl(-1, KDGETLED, &c_status);
>  	printf("ioctl(-1, KDGETLED, %p)" RVAL_EBADF, &c_status);
>  
>  	ioctl(-1, KDSETLED, ul_status);
> -	printf("ioctl(-1, KDSETLED, %d)" RVAL_EBADF, ul_status);
> +	printf("ioctl(-1, KDSETLED, %ld)" RVAL_EBADF, ul_status);
>  
>  	puts("+++ exited with 0 +++");
>  	return 0;

This change probably fixes those two warnings reported by the compiler,
but the test still fails.  I'm not sure that's the purpose of submitting
a test that's expected to fail.

By the way, have you seen a "work in progress" branch esyr/kd?


-- 
ldv


More information about the Strace-devel mailing list