GNU bug report logs -
#10305
coreutils-8.14, "rm -r" fails with EBADF
Previous Next
Full log
View this message in rfc822 format
On 12/18/11 02:31, Joachim Schmitz wrote:
> it seems to go wrong in fcntl.c, line 194:
>
> /* Haiku alpha 2 loses fd flags on original. */
> int flags = fcntl (fd, F_GETFD); <==
> if (flags < 0)
> {
> result = -1;
> break;
> }
>
> that fcntl() returns a -1 with errno set to EBADF.
What is the value of fd at that point?
Is it actually an invalid file descriptor?
> For some reason I can step into that fcntl(), guess it is calling the system's fcntl here?
Yes, that's how it's supposed to work.
If you plant a breakpoint on the parent fts_build,
and single step through that, can you find out whether
continue_readdir is true? If it's true, then please
investigate why dirfd (fts.c line 1285)
returned an invalid file descriptor. If it's false,
then please investigate why opendirat (..., &dir_fd)
(fts.c line 1301) succeeded but set dir_fd to an
invalid file descriptor.
This bug report was last modified 12 years and 110 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.