All of lore.kernel.org
 help / color / mirror / Atom feed
From: Cyril Hrubis <chrubis@suse.cz>
To: Petr Vorel <pvorel@suse.cz>
Cc: ltp@lists.linux.it
Subject: Re: [LTP] [PATCH 1/1] syscalls: Add missing WEXITSTATUS() check
Date: Mon, 11 Nov 2024 17:08:21 +0100	[thread overview]
Message-ID: <ZzIr9bBKPmnN_3YY@yuki.lan> (raw)
In-Reply-To: <20241111143609.185692-1-pvorel@suse.cz>

Hi!
> Signed-off-by: Petr Vorel <pvorel@suse.cz>
> ---
> I haven't found any other test which would need it.
>  testcases/kernel/syscalls/madvise/madvise08.c | 2 +-
>  testcases/kernel/syscalls/select/select03.c   | 2 +-
>  2 files changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/testcases/kernel/syscalls/madvise/madvise08.c b/testcases/kernel/syscalls/madvise/madvise08.c
> index 96bcaf159a..cd5ce722a5 100644
> --- a/testcases/kernel/syscalls/madvise/madvise08.c
> +++ b/testcases/kernel/syscalls/madvise/madvise08.c
> @@ -173,7 +173,7 @@ static pid_t run_child(int advice)
>  	SAFE_WAITPID(pid, &status, 0);
>  	if (WIFSIGNALED(status) && WCOREDUMP(status))
>  		return pid;
> -	if (WIFEXITED(status))
> +	if (WIFEXITED(status) && !WEXITSTATUS(status))
>  		return 0;
>  
>  	tst_res(TCONF, "No coredump produced after signal (%d)",

This one is not complete. We do exit(1) if madvise fails that would be
previously caught here so we have to add:

diff --git a/testcases/kernel/syscalls/madvise/madvise08.c b/testcases/kernel/syscalls/madvise/madvise08.c
index 96bcaf159..f8f74ef4f 100644
--- a/testcases/kernel/syscalls/madvise/madvise08.c
+++ b/testcases/kernel/syscalls/madvise/madvise08.c
@@ -165,7 +165,7 @@ static pid_t run_child(int advice)
                                fmem,
                                FMEMSIZE,
                                advstr);
-                       exit(1);
+                       exit(0);
                }
                abort();
        }


> diff --git a/testcases/kernel/syscalls/select/select03.c b/testcases/kernel/syscalls/select/select03.c
> index 1cec3a4c76..216b22104f 100644
> --- a/testcases/kernel/syscalls/select/select03.c
> +++ b/testcases/kernel/syscalls/select/select03.c
> @@ -77,7 +77,7 @@ static void run(unsigned int n)
>  
>  	SAFE_WAITPID(pid, &status, 0);
>  
> -	if (WIFEXITED(status))
> +	if (WIFEXITED(status) && !WEXITSTATUS(status))
>  		return;
>  
>  	if (tst_variant == GLIBC_SELECT_VARIANT &&
> -- 
> 2.45.2
> 

-- 
Cyril Hrubis
chrubis@suse.cz

-- 
Mailing list info: https://lists.linux.it/listinfo/ltp

  reply	other threads:[~2024-11-11 16:08 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-11-11 14:36 [LTP] [PATCH 1/1] syscalls: Add missing WEXITSTATUS() check Petr Vorel
2024-11-11 16:08 ` Cyril Hrubis [this message]
2024-11-12 11:00   ` Petr Vorel
2024-11-12 12:17     ` Cyril Hrubis
2024-11-12 17:05       ` Petr Vorel

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=ZzIr9bBKPmnN_3YY@yuki.lan \
    --to=chrubis@suse.cz \
    --cc=ltp@lists.linux.it \
    --cc=pvorel@suse.cz \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.