[LTP] [PATCH v2] Rewrite sighold02.c using new LTP API

Richard Palethorpe rpalethorpe@suse.de
Thu Apr 14 11:55:36 CEST 2022


Hello,

Andrea Cervesato <andrea.cervesato@suse.de> writes:

> Removed TST_CHECKPOINT_INIT and replaced it with the .needs_checkpoints
> LTP test feature. Simplified source code.
>
> Signed-off-by: Andrea Cervesato <andrea.cervesato@suse.de>
> ---
>  testcases/kernel/syscalls/sighold/sighold02.c | 180 +++++-------------
>  1 file changed, 48 insertions(+), 132 deletions(-)
>
> diff --git a/testcases/kernel/syscalls/sighold/sighold02.c b/testcases/kernel/syscalls/sighold/sighold02.c
> index b763142df..212e6e78c 100644
> --- a/testcases/kernel/syscalls/sighold/sighold02.c
> +++ b/testcases/kernel/syscalls/sighold/sighold02.c
> @@ -1,74 +1,35 @@
> +// SPDX-License-Identifier: GPL-2.0-or-later
>  /*
>   * Copyright (c) 2000 Silicon Graphics, Inc.  All Rights Reserved.
>   *  AUTHOR          : Bob Clark
>   *  CO-PILOT        : Barrie Kletscher
>   *  DATE STARTED    : 9/26/86
>   * Copyright (C) 2015 Cyril Hrubis <chrubis@suse.cz>
> - *
> - * This program is free software; you can redistribute it and/or modify it
> - * under the terms of version 2 of the GNU General Public License as
> - * published by the Free Software Foundation.
> - *
> - * This program is distributed in the hope that it would be useful, but
> - * WITHOUT ANY WARRANTY; without even the implied warranty of
> - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
> - *
> - * Further, this software is distributed without any warranty that it is
> - * free of the rightful claim of any third person regarding infringement
> - * or the like.  Any license provided herein, whether implied or
> - * otherwise, applies only to this software file.  Patent licenses, if
> - * any, provided herein do not apply to combinations of this program with
> - * other software, or any other product whatsoever.
> - *
> - * You should have received a copy of the GNU General Public License along
> - * with this program; if not, write the Free Software Foundation, Inc.,
> - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
> - *
> - * Contact information: Silicon Graphics, Inc., 1600 Amphitheatre Pkwy,
> - * Mountain View, CA  94043, or:
> - *
> - * http://www.sgi.com
> - *
> - * For further information regarding this notice, see:
> - *
> - * http://oss.sgi.com/projects/GenInfo/NoticeExplan/
> + * Copyright (C) 2021 SUSE LLC Andrea Cervesato <andrea.cervesato@suse.com>
                    ^2022
>   */
> -/*
> - * TEST ITEMS
> - *	1. sighold action to turn off the receipt of all signals was done
> - *	   without error.
> +
> +/*\
> + * [Description]
> + *
> + * This test checks following conditions:
> + *	1. sighold action to turn off the receipt of all signals was done without error.
>   *	2. After signals were held, and sent, no signals were trapped.
>   */
> -#define _XOPEN_SOURCE 500
> -#include <errno.h>
> +
> +#define _XOPEN_SOURCE 600
>  #include <signal.h>
> -#include <string.h>
> -#include <fcntl.h>
> -#include <stdlib.h>
> -#include <sys/types.h>
> -#include <sys/wait.h>
> -#include "test.h"
> -#include "safe_macros.h"
> -#include "lapi/signal.h"
> +#include "tst_test.h"
>  
>  /* _XOPEN_SOURCE disables NSIG */
>  #ifndef NSIG
> -# define NSIG _NSIG
> +#	define NSIG _NSIG
>  #endif
>  
>  /* ensure NUMSIGS is defined */

Comments like this can be removed

With those fixed:

Reviewed-by: Richard Palethorpe <rpalethorpe@suse.com>

-- 
Thank you,
Richard.


More information about the ltp mailing list