On Fri, 2009-06-12 at 18:58 +0530, naresh kamboju wrote: 
> Hi,
> 
> I have noticed failures under
> testcases/open_posix_testsuite/conformance/interfaces/aio_error/3-1.c
> and fixed.
> Please find the patch below and as attachment.
> 
> Best regards
> Naresh Kamboju
> 
> Signed-off-by: Naresh Kamboju < [email protected] >

Thanks.

Regards--
Subrata

> 
> diff -Naurb 
> a/testcases/open_posix_testsuite/conformance/interfaces/aio_error/3-1.c
> b/testcases/open_posix_testsuite/conformance/interfaces/aio_error/3-1.c
> --- a/testcases/open_posix_testsuite/conformance/interfaces/aio_error/3-1.c   
> 2009-06-12
> 18:03:14.000000000 +0530
> +++ b/testcases/open_posix_testsuite/conformance/interfaces/aio_error/3-1.c   
> 2009-06-12
> 18:00:21.000000000 +0530
> @@ -36,29 +36,55 @@
> 
>  int main()
>  {
> -     struct aiocb bad;
> -     int ret;
> +
> +        char tmpfname[256];
> +#define BUF_SIZE 512
> +        char buf[BUF_SIZE];
> +        int fd;
> +        struct aiocb aiocb;
> +     int ret=0;
> 
>  #if _POSIX_ASYNCHRONOUS_IO != 200112L
> -     return PTS_UNSUPPORTED;
> +        exit(PTS_UNSUPPORTED);
>  #endif
> 
> -     memset (&bad, 0, sizeof (struct aiocb));
> +        snprintf(tmpfname, sizeof(tmpfname), "/tmp/pts_aio_error_3_1_%d",
> +                  getpid());
> +        unlink(tmpfname);
> +        fd = open(tmpfname, O_CREAT | O_RDWR | O_EXCL,
> +                  S_IRUSR | S_IWUSR);
> +        if (fd == -1)
> +        {
> +                printf(TNAME " Error at open(): %s\n",
> +                       strerror(errno));
> +                exit(PTS_UNRESOLVED);
> +        }
> +
> +        unlink(tmpfname);
> +
> +     memset (&aiocb, 0, sizeof (struct aiocb));
> 
> -     ret = aio_error(&bad);
> -     if (ret != -1)
> +        aiocb.aio_fildes = fd;
> +        aiocb.aio_buf = buf;
> +        aiocb.aio_reqprio = -1;
> +        aiocb.aio_nbytes = BUF_SIZE;
> +
> +        if (aio_write(&aiocb) != 0)
>       {
> -             printf(TNAME " bad aio_error return value; %d\n", ret);
> -             return PTS_FAIL;
> +                printf(TNAME " bad aio_read return value()\n");
> +                exit(PTS_FAIL);
>       }
> 
> -     if (errno != EINVAL)
> +     while (aio_error (&aiocb) == EINPROGRESS);
> +     ret = aio_error(&aiocb);
> +
> +     if (ret != EINVAL)
>       {
>               printf(TNAME " errno is not EINVAL %s\n", strerror(errno));
>               return PTS_FAIL;
>       }
> 
> -
> +     close(fd);
>       printf ("Test PASSED\n");
>       return PTS_PASS;
>  }


------------------------------------------------------------------------------
Crystal Reports - New Free Runtime and 30 Day Trial
Check out the new simplified licensing option that enables unlimited
royalty-free distribution of the report engine for externally facing 
server and web deployment.
http://p.sf.net/sfu/businessobjects
_______________________________________________
Ltp-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list

Reply via email to