[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
test-fsync failures
From: |
Bruno Haible |
Subject: |
test-fsync failures |
Date: |
Sun, 19 Jun 2011 03:18:55 +0200 |
User-agent: |
KMail/1.9.9 |
> 3 x FAIL: test-fsync
When stdin is connected to a socket (or pipe?) set up by sshd:
- On MacOS X, fsync (0) fails with ENOTSUP instead of EINVAL.
- On AIX 7.1, fsync (0) fails with EBADF instead of EINVAL.
This patch fixes the failure, by relaxing the test.
2011-06-18 Bruno Haible <address@hidden>
fsync test: Avoid test failure on MacOS X and AIX.
* tests/test-fsync.c (fsync): Allow ENOTSUP and EBADF instead of
EINVAL.
--- tests/test-fsync.c.orig Sun Jun 19 03:12:30 2011
+++ tests/test-fsync.c Sun Jun 19 03:11:31 2011
@@ -33,7 +33,12 @@
const char *file = "test-fsync.txt";
if (fsync (0) != 0)
- ASSERT (errno == EINVAL);
+ {
+ ASSERT (errno == EINVAL /* POSIX */
+ || errno == ENOTSUP /* seen on MacOS X 10.5 */
+ || errno == EBADF /* seen on AIX 7.1 */
+ );
+ }
fd = open (file, O_WRONLY|O_CREAT|O_TRUNC, 0644);
ASSERT (0 <= fd);
ASSERT (write (fd, "hello", 5) == 5);
--
In memoriam Mona Mahmudnizhad <http://en.wikipedia.org/wiki/Mona_Mahmudnizhad>