From: Petr Vorel <pvorel@suse.cz>
To: Avinesh Kumar <akumar@suse.de>
Cc: ltp@lists.linux.it
Subject: Re: [LTP] [PATCH] syscalls/mmap06: use macro TST_EXP_FAIL_PTR_VOID()
Date: Tue, 7 May 2024 18:53:47 +0200 [thread overview]
Message-ID: <20240507165347.GB157588@pevik> (raw)
In-Reply-To: <20240429194021.5523-1-akumar@suse.de>
Hi Avinesh,
...
> - TESTPTR(mmap(NULL, tc->length, tc->prot, tc->flags, fd, 0));
> -
> - if (TST_RET_PTR != MAP_FAILED) {
> - tst_res(TFAIL, "mmap() was successful unexpectedly");
> - SAFE_MUNMAP(TST_RET_PTR, MMAPSIZE);
> - } else if (TST_ERR == tc->exp_errno) {
> - tst_res(TPASS | TERRNO, "mmap() failed with");
> - } else {
> - tst_res(TFAIL | TERRNO, "mmap() failed unexpectedly");
> - }
> + TST_EXP_FAIL_PTR_VOID(mmap(NULL, tc->length, tc->prot, tc->flags, fd, 0), tc->exp_errno);
Also here should IMHO be:
if (TST_RET_PTR != MAP_FAILED) {
SAFE_MUNMAP(TST_RET_PTR, page_sz);
Kind regards,
Petr
> }
> static void cleanup(void)
--
Mailing list info: https://lists.linux.it/listinfo/ltp
next prev parent reply other threads:[~2024-05-07 16:54 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-04-29 19:40 [LTP] [PATCH] syscalls/mmap06: use macro TST_EXP_FAIL_PTR_VOID() Avinesh Kumar
2024-05-07 16:53 ` Petr Vorel [this message]
2024-05-13 13:07 ` [LTP] [PATCH v2] " Avinesh Kumar
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=20240507165347.GB157588@pevik \
--to=pvorel@suse.cz \
--cc=akumar@suse.de \
--cc=ltp@lists.linux.it \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox