Update of /cvsroot/ltp/ltp/testcases/kernel/io/ltp-aiodio
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv25388
Modified Files:
aiodio_append.c
Log Message:
-
A patch submitted by Jacky Malcles that fixes a problem with aiodio_append.c .
This change checks to see if io_getevents returns a valid value.
-
Index: aiodio_append.c
===================================================================
RCS file: /cvsroot/ltp/ltp/testcases/kernel/io/ltp-aiodio/aiodio_append.c,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** aiodio_append.c 25 Feb 2004 23:47:05 -0000 1.1
--- aiodio_append.c 19 Apr 2006 22:01:52 -0000 1.2
***************
*** 137,146 ****
*/
for (; i < 1000; i++) {
! int n;
struct iocb *iocbp;
!
n = io_getevents(myctx, 1, 1, &event, &timeout);
iocbp = (struct iocb *)event.obj;
io_prep_pwrite(iocbp, fd, iocbp->u.c.buf, AIO_SIZE, offset);
offset += AIO_SIZE;
--- 137,147 ----
*/
for (; i < 1000; i++) {
! int n = 0;
struct iocb *iocbp;
!
n = io_getevents(myctx, 1, 1, &event, &timeout);
iocbp = (struct iocb *)event.obj;
+ if( n > 0){
io_prep_pwrite(iocbp, fd, iocbp->u.c.buf, AIO_SIZE, offset);
offset += AIO_SIZE;
***************
*** 148,151 ****
--- 149,153 ----
fprintf(stderr, "write %d returned %d\n", i, w);
}
+ }
}
}
|