Wait for aio_write() completion. If aio_fsync() sync the fd without the previous aio_write() completion, it will cause Segment Fault.
Signed-off-by: Wanlong Gao <[email protected]> --- .../open_posix_testsuite/conformance/interfaces/aio_fsync/14-1.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/testcases/open_posix_testsuite/conformance/interfaces/aio_fsync/14-1.c b/testcases/open_posix_testsuite/conformance/interfaces/aio_fsync/14-1.c index a9cd3bf..e15f084 100644 --- a/testcases/open_posix_testsuite/conformance/interfaces/aio_fsync/14-1.c +++ b/testcases/open_posix_testsuite/conformance/interfaces/aio_fsync/14-1.c @@ -27,6 +27,7 @@ int main() #define BUF_SIZE 111 char buf[BUF_SIZE]; int fd; + int ret; struct aiocb aiocb_write; struct aiocb aiocb_fsync; @@ -57,6 +58,14 @@ int main() exit(PTS_FAIL); } + while ((ret = aio_error(&aiocb_write) == EINPROGRESS)) + usleep(10000); + if (ret < 0) { + printf(TNAME " Error at aio_error() : %s\n", strerror(ret)); + exit(PTS_FAIL); + } + + memset(&aiocb_fsync, 0, sizeof(aiocb_fsync)); aiocb_fsync.aio_fildes = fd; -- 1.7.11.3.287.ge771946 ------------------------------------------------------------------------------ Live Security Virtual Conference Exclusive live event will cover all the ways today's security and threat landscape has changed and how IT managers can respond. Discussions will include endpoint security, mobile security and the latest in malware threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ _______________________________________________ Ltp-list mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/ltp-list
