On mingw, I'm seeing this test failure:
test-fsync.c:43: assertion failed
FAIL: test-fsync.exe
This fixes it. But the test then later failus at
test-fsync.c:73: assertion failed
2011-09-20 Bruno Haible
fsync tests: Avoid a test failure on mingw.
* tests/test-fsync.c (main):
Eric Blake wrote:
> > Why not test both? Like this proposed patch. ...
>
> Looks good to me. Maybe we should also test reopening file in O_RDONLY
> mode, since fsync on a tty is much different than fsync on a regular file.
The idea of checking fd 0 is that it's likely in O_RDONLY mode.
> POSIX
On 09/16/2011 02:37 PM, Bruno Haible wrote:
The original intent of that code was to test the behaviour of fsync on a
read-only file descriptor, and STDIN_FILENO is one. Why should it be better
to test STDOUT_FILENO?
Why not test both? Like this proposed patch. (Which also add blank
lines as sepa
Eric Blake wrote:
>
> - if (fsync (0) != 0)
> + if (fsync (STDOUT_FILENO) != 0)
> {
>ASSERT (errno == EINVAL /* POSIX */
>|| errno == ENOTSUP /* seen on MacOS X 10.5 */
>|| errno == EBADF /* seen on AIX 7.1 */
> - );
> + );
>
This test failed to compile on mingw, which lacks ENOTSUP. Furthermore,
it wasn't testing POSIX behavior on invalid fds.
* modules/fsync-tests (Depends-on): Add errno, for mingw.
* tests/test-fsync.c (main): Enhance test.
Signed-off-by: Eric Blake
---
ChangeLog |6 ++
modules