[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: fdopendir closes the file descriptor on MinGW

From: Eli Zaretskii
Subject: Re: fdopendir closes the file descriptor on MinGW
Date: Thu, 19 Mar 2015 05:47:42 +0200

> Date: Wed, 18 Mar 2015 17:27:23 -0600
> From: Eric Blake <address@hidden>
> CC: address@hidden
> I think POSIX 2001 allowed that, but with the openat() and friends added
> in POSIX 2008, I think that POSIX now prohibits this implementation, and
> requires that dirfd work rather than giving up with ENOTSUP.  At any
> rate, gnulib should try and strive for returning a non-negative value,
> even if POSIX has a loophole that would allow -1.

In any case, the bug that triggered this thread clearly shows that
dirfd should not fail, if it is part of the solution, because the file
descriptor with which the directory was open must remain open after
fdopendir returns.  It clearly is what Grep assumes.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]