[LTP] [PATCH] syscalls/madvise06: Change drop_caches file checking mode

Cyril Hrubis chrubis@suse.cz
Wed Jan 15 16:00:23 CET 2020


Hi!
> ---
>  testcases/kernel/syscalls/madvise/madvise06.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/testcases/kernel/syscalls/madvise/madvise06.c b/testcases/kernel/syscalls/madvise/madvise06.c
> index 37840d0..329f558 100644
> --- a/testcases/kernel/syscalls/madvise/madvise06.c
> +++ b/testcases/kernel/syscalls/madvise/madvise06.c
> @@ -49,7 +49,7 @@ static void setup(void)
> 
>  	pg_sz = getpagesize();
> 
> -	check_path(drop_caches_fname);
> +	access(drop_caches_fname, W_OK);

If you are not checking the return value it's no-op. Also the file has
been added to Linux kernel 14 years ago, so it's safe to assume it's
present. Hence I've modified to patch to simply remove the check.

Thanks.

-- 
Cyril Hrubis
chrubis@suse.cz


More information about the ltp mailing list