[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: test-fsync failure on Haiku
From: |
Jim Meyering |
Subject: |
Re: test-fsync failure on Haiku |
Date: |
Sun, 16 Nov 2008 08:57:15 +0100 |
Bruno Haible <address@hidden> wrote:
> Hi Richard, Jim,
>
> The test-fsync test is failing on Haiku, at line 40. fsync (stdin), when
> stdin refers to a terminal input, simply succeeds on this system. I don't
> see anything in POSIX which would mandate a failure of this call.
>
> OK to make the test a bit weaker?
Sure. It'd be nice to mention Haiku in the log,
or just to reference this thread.
> 2008-11-15 Bruno Haible <address@hidden>
>
> * tests/test-fsync.c: Include <errno.h>.
> (main): Don't require that fsync (0) fails.
>
> --- tests/test-fsync.c.orig 2008-11-15 23:43:24.000000000 +0100
> +++ tests/test-fsync.c 2008-11-15 23:42:45.000000000 +0100
> @@ -15,6 +15,8 @@
> along with this program. If not, see <http://www.gnu.org/licenses/>. */
>
> #include <config.h>
> +
> +#include <errno.h>
> #include <stdio.h>
> #include <fcntl.h>
> #include <unistd.h>
> @@ -37,7 +39,8 @@
> int fd;
> const char *file = "test-fsync.txt";
>
> - ASSERT (fsync (0) != 0);
> + if (fsync (0) != 0)
> + ASSERT (errno == EINVAL);
> fd = open (file, O_WRONLY|O_CREAT|O_TRUNC, 0644);
> ASSERT (0 <= fd);
> ASSERT (write (fd, "hello", 5) == 5);