Hi! > Signed-off-by: Peng Haitao <[email protected]> > --- > .../conformance/interfaces/aio_cancel/7-1.c | 6 +++--- > 1 files changed, 3 insertions(+), 3 deletions(-) > > diff --git > a/testcases/open_posix_testsuite/conformance/interfaces/aio_cancel/7-1.c > b/testcases/open_posix_testsuite/conformance/interfaces/aio_cancel/7-1.c > index c37f184..756b0af 100644 > --- a/testcases/open_posix_testsuite/conformance/interfaces/aio_cancel/7-1.c > +++ b/testcases/open_posix_testsuite/conformance/interfaces/aio_cancel/7-1.c > @@ -112,8 +112,6 @@ int main() > return PTS_FAIL; > } > > - close(fd); > - > do { > in_progress = 0; > for (i = 0; i < BUF_NB; i++) > @@ -161,5 +159,7 @@ int main() > } > } while (in_progress); > > + close(fd); > + > return PTS_UNRESOLVED;
Yes, closing the fd before aio operation is completed is wrong. However the fix is not 100% correct either. The file would be closed only when you get out of the do while() loop, which has several returns there. So we may rather: * change the code to close the fd correctly or * don't close the fd at all as we don't care about the file anyway -- Cyril Hrubis [email protected] ------------------------------------------------------------------------------ Special Offer -- Download ArcSight Logger for FREE! Finally, a world-class log management solution at an even better price-free! And you'll get a free "Love Thy Logs" t-shirt when you download Logger. Secure your free ArcSight Logger TODAY! http://p.sf.net/sfu/arcsisghtdev2dev _______________________________________________ Ltp-list mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/ltp-list
