[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: mkfifoat tests on mingw
From: |
Bruno Haible |
Subject: |
Re: mkfifoat tests on mingw |
Date: |
Sat, 1 Oct 2011 10:52:55 +0200 |
User-agent: |
KMail/1.13.6 (Linux/2.6.37.6-0.5-desktop; KDE/4.6.0; x86_64; ; ) |
I've committed this patch now:
> 2011-09-21 Bruno Haible <address@hidden>
>
> mkfifoat tests: Fix a test failure on mingw.
> * tests/test-mkfifoat.c (main): Allow mkfifoat or test_mknodat to fail
> with error ENOSYS.
>
> --- tests/test-mkfifoat.c.orig Thu Sep 22 02:12:07 2011
> +++ tests/test-mkfifoat.c Wed Sep 21 22:42:49 2011
> @@ -106,32 +106,41 @@
> }
>
> /* Create fifo while cwd is '.', then stat it from '..'. */
> - ASSERT (func (AT_FDCWD, BASE "fifo", 0600) == 0);
> - errno = 0;
> - ASSERT (func (dfd, BASE "fifo", 0600) == -1);
> - ASSERT (errno == EEXIST);
> - ASSERT (chdir ("..") == 0);
> - errno = 0;
> - ASSERT (fstatat (AT_FDCWD, BASE "fifo", &st, 0) == -1);
> - ASSERT (errno == ENOENT);
> - memset (&st, 0, sizeof st);
> - ASSERT (fstatat (dfd, BASE "fifo", &st, 0) == 0);
> - ASSERT (S_ISFIFO (st.st_mode));
> - ASSERT (unlinkat (dfd, BASE "fifo", 0) == 0);
> + if (func (AT_FDCWD, BASE "fifo", 0600) != 0)
> + ASSERT (errno == ENOSYS); /* seen on native Windows */
> + else
> + {
> + errno = 0;
> + ASSERT (func (dfd, BASE "fifo", 0600) == -1);
> + ASSERT (errno == EEXIST);
> + ASSERT (chdir ("..") == 0);
> + errno = 0;
> + ASSERT (fstatat (AT_FDCWD, BASE "fifo", &st, 0) == -1);
> + ASSERT (errno == ENOENT);
> + memset (&st, 0, sizeof st);
> + ASSERT (fstatat (dfd, BASE "fifo", &st, 0) == 0);
> + ASSERT (S_ISFIFO (st.st_mode));
> + ASSERT (unlinkat (dfd, BASE "fifo", 0) == 0);
> + }
>
> /* Create fifo while cwd is '..', then stat it from '.'. */
> - ASSERT (func (dfd, BASE "fifo", 0600) == 0);
> - ASSERT (fchdir (dfd) == 0);
> - errno = 0;
> - ASSERT (func (AT_FDCWD, BASE "fifo", 0600) == -1);
> - ASSERT (errno == EEXIST);
> - memset (&st, 0, sizeof st);
> - ASSERT (fstatat (AT_FDCWD, BASE "fifo", &st, AT_SYMLINK_NOFOLLOW) ==
> 0);
> - ASSERT (S_ISFIFO (st.st_mode));
> - memset (&st, 0, sizeof st);
> - ASSERT (fstatat (dfd, BASE "fifo", &st, AT_SYMLINK_NOFOLLOW) == 0);
> - ASSERT (S_ISFIFO (st.st_mode));
> - ASSERT (unlink (BASE "fifo") == 0);
> + if (func (dfd, BASE "fifo", 0600) != 0)
> + ASSERT (errno == ENOSYS); /* seen on native Windows */
> + else
> + {
> + ASSERT (fchdir (dfd) == 0);
> + errno = 0;
> + ASSERT (func (AT_FDCWD, BASE "fifo", 0600) == -1);
> + ASSERT (errno == EEXIST);
> + memset (&st, 0, sizeof st);
> + ASSERT (fstatat (AT_FDCWD, BASE "fifo", &st, AT_SYMLINK_NOFOLLOW)
> + == 0);
> + ASSERT (S_ISFIFO (st.st_mode));
> + memset (&st, 0, sizeof st);
> + ASSERT (fstatat (dfd, BASE "fifo", &st, AT_SYMLINK_NOFOLLOW) == 0);
> + ASSERT (S_ISFIFO (st.st_mode));
> + ASSERT (unlink (BASE "fifo") == 0);
> + }
> }
>
> ASSERT (close (dfd) == 0);
--
In memoriam Max Ehrlich <http://en.wikipedia.org/wiki/Max_Ehrlich>
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- Re: mkfifoat tests on mingw,
Bruno Haible <=