This is the mail archive of the glibc-bugs@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug stdio/21398] freopen does not check dup3 return value, and does not return error if dup3 fails (seen when open returns fd 0, and freopen on stdin)


https://sourceware.org/bugzilla/show_bug.cgi?id=21398

Florian Weimer <fweimer at redhat dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |fweimer at redhat dot com

--- Comment #2 from Florian Weimer <fweimer at redhat dot com> ---
(In reply to Andreas Schwab from comment #1)
> I don't think using a stream where the underlying file descriptor is closed
> has defined behviour.

This conflicts with previous guidance I got.  Applications are supposed to be
able to close descriptors used by the library (which is why we can't keep open
a descriptor for /dev/urandom, for example).  Given this, it appears to be
reasonable to expect that it is possible to resurrect a stream using freopen if
its underlying descriptor has been closed.

-- 
You are receiving this mail because:
You are on the CC list for the bug.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]