public inbox for ltp@lists.linux.it
 help / color / mirror / Atom feed
From: Wanlong Gao <gaowanlong@cn.fujitsu.com>
To: Peng Haitao <penght@cn.fujitsu.com>
Cc: ltp-list@lists.sourceforge.net
Subject: Re: [LTP] [PATCH v5] aio_read:8-1.c: Forget initializing struct aiocb before using it
Date: Wed, 21 Mar 2012 16:45:49 +0800	[thread overview]
Message-ID: <4F69953D.5060007@cn.fujitsu.com> (raw)
In-Reply-To: <1332319408-18331-1-git-send-email-penght@cn.fujitsu.com>

On 03/21/2012 04:43 PM, Peng Haitao wrote:

> There are 2 changes in this patch.
>  1. Initialize the aiocb struct before using it.
>  2. If Prioritized Input and Output option is supported, submit the
>     aiocb with invalid aio_reqprio, else return untested.
> 
> Signed-off-by: Peng Haitao <penght@cn.fujitsu.com>


thanks Peng.

ACK.

> ---
>  .../conformance/interfaces/aio_read/8-1.c               |   13 +++++++------
>  .../conformance/interfaces/aio_write/6-1.c              |   15 ++++++++-------
>  2 files changed, 15 insertions(+), 13 deletions(-)
> 
> diff --git a/testcases/open_posix_testsuite/conformance/interfaces/aio_read/8-1.c b/testcases/open_posix_testsuite/conformance/interfaces/aio_read/8-1.c
> index 8054eeb..ea0538e 100644
> --- a/testcases/open_posix_testsuite/conformance/interfaces/aio_read/8-1.c
> +++ b/testcases/open_posix_testsuite/conformance/interfaces/aio_read/8-1.c
> @@ -14,7 +14,8 @@
>   *
>   * method:
>   *
> - *	- fill in an aiocb with a NULL aio_buf
> + *	- if Prioritized Input and Output option is supported, fill in an
> + *	  aiocb with invalid aio_reqprio.
>   *	- call aio_read
>   *	- check aio_read return value
>   */
> @@ -41,11 +42,11 @@ int main()
>  	if (sysconf(_SC_ASYNCHRONOUS_IO) < 200112L)
>  		return PTS_UNSUPPORTED;
>  
> -	/* submit a request with a NULL buffer */
> -	aiocb.aio_fildes = 0;
> -	aiocb.aio_buf = NULL;
> -	aiocb.aio_nbytes = 0;
> -	aiocb.aio_offset = 0;
> +	if (sysconf(_SC_PRIORITIZED_IO) < 200112L)
> +		return PTS_UNTESTED;
> +
> +	memset(&aiocb, 0, sizeof(struct aiocb));
> +	aiocb.aio_reqprio = -1;
>  
>  	if (aio_read(&aiocb) != -1) {
>  		printf(TNAME " aio_read() should fail!\n");
> diff --git a/testcases/open_posix_testsuite/conformance/interfaces/aio_write/6-1.c b/testcases/open_posix_testsuite/conformance/interfaces/aio_write/6-1.c
> index 98b8d0d..744c82c 100644
> --- a/testcases/open_posix_testsuite/conformance/interfaces/aio_write/6-1.c
> +++ b/testcases/open_posix_testsuite/conformance/interfaces/aio_write/6-1.c
> @@ -14,7 +14,8 @@
>   *
>   * method:
>   *
> - *	- fill in an aiocb with a NULL aio_buf
> + *	- if Prioritized Input and Output option is supported, fill in an
> + *	  aiocb with invalid aio_reqprio
>   *	- call aio_write
>   *	- check aio_write return value
>   *
> @@ -42,11 +43,11 @@ int main()
>  	if (sysconf(_SC_ASYNCHRONOUS_IO) < 200112L)
>  		return PTS_UNSUPPORTED;
>  
> -	/* submit a request with a NULL buffer */
> -	aiocb.aio_fildes = 0;
> -	aiocb.aio_buf = NULL;
> -	aiocb.aio_nbytes = 0;
> -	aiocb.aio_offset = 0;
> +	if (sysconf(_SC_PRIORITIZED_IO) < 200112L)
> +		return PTS_UNTESTED;
> +
> +	memset(&aiocb, 0, sizeof(struct aiocb));
> +	aiocb.aio_reqprio = -1;
>  
>  	if (aio_write(&aiocb) != -1)
>  	{
> @@ -62,4 +63,4 @@ int main()
>  
>  	printf ("Test PASSED\n");
>  	return PTS_PASS;
> -}
> \ No newline at end of file
> +}



------------------------------------------------------------------------------
This SF email is sponsosred by:
Try Windows Azure free for 90 days Click Here 
http://p.sf.net/sfu/sfd2d-msazure
_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list

  reply	other threads:[~2012-03-21  8:46 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <4F62A9E1.2040502@cn.fujitsu.com>
     [not found] ` <1331884731-11231-1-git-send-email-penght@cn.fujitsu.com>
     [not found]   ` <4F62F3F8.5080707@cn.fujitsu.com>
2012-03-16  9:48     ` [LTP] [PATCH v4] aio_read:8-1.c: Forget initializing struct aiocb before using it Garrett Cooper
2012-03-16 10:07       ` Peng Haitao
2012-03-21  8:43         ` [LTP] [PATCH v5] " Peng Haitao
2012-03-21  8:45           ` Wanlong Gao [this message]
2012-03-22 13:07           ` Wanlong Gao

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=4F69953D.5060007@cn.fujitsu.com \
    --to=gaowanlong@cn.fujitsu.com \
    --cc=ltp-list@lists.sourceforge.net \
    --cc=penght@cn.fujitsu.com \
    /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