[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH] test-fsync: yet another enhancement
From: |
Bruno Haible |
Subject: |
Re: [PATCH] test-fsync: yet another enhancement |
Date: |
Wed, 21 Sep 2011 22:13:10 +0200 |
User-agent: |
KMail/1.13.6 (Linux/2.6.37.6-0.5-desktop; KDE/4.6.0; x86_64; ; ) |
Hi Eric,
> + /* For a read-only regular file input file descriptor, fsync should
> + succeed (since at least atime changes can be synchronized). */
> + fd = open (file, O_RDONLY);
> + ASSERT (0 <= fd);
> + {
> + char buf[1];
> + ASSERT (read (fd, buf, sizeof buf) == sizeof buf);
> + }
> + ASSERT (fsync (fd) == 0); <===
> + ASSERT (close (fd) == 0);
> +
This test fails on several platforms:
- AIX 5.1..7.1,
- Cygwin 1.5.25, Cygwin 1.7.9,
- mingw.
I think it makes unportable assumptions, and it's better to relax the test
than to override fsync() in gnulib.
Bruno
--
In memoriam Orlando Letelier <http://en.wikipedia.org/wiki/Orlando_Letelier>