From: Subrata Modak <subrata@linux.vnet.ibm.com>
To: Jiri Palecek <jpalecek@web.de>
Cc: ltp-list@lists.sourceforge.net
Subject: Re: [LTP] [PATCH] Fix temporary file creation in mmapstress tests
Date: Mon, 26 Oct 2009 22:32:21 +0530 [thread overview]
Message-ID: <1256576541.4929.53.camel@subratamodak.linux.ibm.com> (raw)
In-Reply-To: <200910041139.n94Bde05022152@e33.co.us.ibm.com>
On Sun, 2009-06-07 at 02:32 +0200, Jiri Palecek wrote:
> Hello,
>
> these are two little fixes of the mmapstress test.
>
> - the mkstemp() function returns -1 on error; the tests treat 0 as
> error instead
>
> - mkstemp() returns a file descriptor; no need to open the file once
> more later
>
> Regards
> Jiri Palecek
>
> Signed-off-by: Jiri Palecek <jpalecek@web.de>
Thanks.
Regards--
Subrata
> ---
> testcases/kernel/mem/mmapstress/mmapstress02.c | 6 +-----
> testcases/kernel/mem/mmapstress/mmapstress05.c | 6 +-----
> 2 files changed, 2 insertions(+), 10 deletions(-)
>
> diff --git a/testcases/kernel/mem/mmapstress/mmapstress02.c b/testcases/kernel/mem/mmapstress/mmapstress02.c
> index a0f0693..f801a2e 100644
> --- a/testcases/kernel/mem/mmapstress/mmapstress02.c
> +++ b/testcases/kernel/mem/mmapstress/mmapstress02.c
> @@ -101,7 +101,7 @@ main(int argc, char *argv[]) {
> return 1;
> }
> (void)time(&t);
> - if (!(fd = mkstemp(tmpname))) {
> + if ((fd = mkstemp(tmpname)) == -1) {
> ERROR("mkstemp failed");
> anyfail();
> }
> @@ -114,10 +114,6 @@ main(int argc, char *argv[]) {
> CATCH_SIG(SIGINT);
> CATCH_SIG(SIGQUIT);
> CATCH_SIG(SIGTERM);
> - if ((fd = open(tmpname, O_CREAT|O_RDWR, 0777)) == -1) {
> - ERROR("couldn't open temporary file");
> - anyfail();
> - }
> if (sbrk(2*pagesize - ((ulong)sbrk(0) & (pagesize-1))) == (char *)-1) {
> CLEANERROR("couldn't round up brk");
> anyfail();
> diff --git a/testcases/kernel/mem/mmapstress/mmapstress05.c b/testcases/kernel/mem/mmapstress/mmapstress05.c
> index 9155834..4d25b8d 100644
> --- a/testcases/kernel/mem/mmapstress/mmapstress05.c
> +++ b/testcases/kernel/mem/mmapstress/mmapstress05.c
> @@ -133,7 +133,7 @@ main(int argc, char *argv[])
> -- sreeni
> */
>
> - if (!(fd = mkstemp(tmpname))) {
> + if ((fd = mkstemp(tmpname))==-1) {
> ERROR("mkstemp failed");
> anyfail();
> }
> @@ -146,10 +146,6 @@ main(int argc, char *argv[])
> CATCH_SIG(SIGINT);
> CATCH_SIG(SIGQUIT);
> CATCH_SIG(SIGTERM);
> - if ((fd = open(tmpname, O_RDWR|O_CREAT, 0777)) == -1) {
> - ERROR("open failed");
> - anyfail();
> - }
> for (i = 0; i < pagesize; i++)
> buf[i] = 'a';
> if (write(fd, buf, pagesize) != pagesize) {
------------------------------------------------------------------------------
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference
_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list
next parent reply other threads:[~2009-10-26 17:02 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <200910041139.n94Bde05022152@e33.co.us.ibm.com>
2009-10-26 17:02 ` Subrata Modak [this message]
2009-06-07 0:32 [LTP] [PATCH] Fix temporary file creation in mmapstress tests Jiri Palecek
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=1256576541.4929.53.camel@subratamodak.linux.ibm.com \
--to=subrata@linux.vnet.ibm.com \
--cc=jpalecek@web.de \
--cc=ltp-list@lists.sourceforge.net \
/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