[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
freebsd-8.1 fails fdopendir test
From: |
Jim Meyering |
Subject: |
freebsd-8.1 fails fdopendir test |
Date: |
Fri, 04 Feb 2011 15:34:30 +0100 |
Given this code from test-fdopendir.c, FreeBSD 8.1 fails
int
main (void)
{
DIR *d;
int fd;
/* A non-directory cannot be turned into a directory stream. */
fd = open ("test-fdopendir.tmp", O_RDONLY | O_CREAT, 0600);
ASSERT (0 <= fd);
errno = 0;
ASSERT (fdopendir (fd) == NULL);
ASSERT (errno == ENOTDIR);
ASSERT (close (fd) == 0);
...
because the close returns nonzero.
It sets errno to EBADF.
It's pretty obvious that this is a bug.
This is probably not relevant to coreutils,
(I don't think it can be made to call fdopendir on a non-dir FD)
so addressing it is not urgent.
- freebsd-8.1 fails fdopendir test,
Jim Meyering <=