From: Wanlong G. <gao...@cn...> - 2011-10-28 02:00:34
|
On 10/27/2011 07:58 PM, Cyril Hrubis wrote: >> >> - if (aio_error(&aiocb_fsync) < 0) >> + while ((ret = aio_error(&aiocb_fsync)) == EINPROGRESS) >> + usleep(10); > > I would add a higher value here. At least 10000 (which would still do > the check hundred times in one second). done > > Ah, right, we check the return value from aio_fsync() which is 0 or -1 > (I've thought that we were checking for the return value from > aio_write() which should be buffer size). > > But the in both cases the error number (eg. errno value) is returned by > the aio_error() call. So in the first case you should use strerror(ret) > and it shouldn't be at all in the second printf(). sure, done. > > And for the coding style, the opening curly bracket should really be on > the same line as the if(). I know these tests are inconsistent but that > is one more reason to fix them. sure, I just wanted to be consistent with the others. Hmm..., I had fix them now. > >> close(fd); >> printf ("Test PASSED\n"); > > And please remove the space after printf here. > >> return PTS_PASS; >> -} >> \ No newline at end of file >> +} > > Maybe it would be best to send two patches, one that fixes the coding > style and one that fixes the functionality... > Sure, two patches have been sent. If they have some thing else, I will fix and resend on next Monday because the weekend is coming now. Thanks -Wanlong Gao |