This is the mail archive of the
glibc-bugs@sourceware.org
mailing list for the glibc project.
[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)
- From: "fweimer at redhat dot com" <sourceware-bugzilla at sourceware dot org>
- To: glibc-bugs at sourceware dot org
- Date: Wed, 19 Apr 2017 10:35:24 +0000
- Subject: [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)
- Auto-submitted: auto-generated
- References: <bug-21398-131@http.sourceware.org/bugzilla/>
https://sourceware.org/bugzilla/show_bug.cgi?id=21398
--- Comment #4 from Florian Weimer <fweimer at redhat dot com> ---
(In reply to Andreas Schwab from comment #3)
> In the (non-normative) application usage of close POSIX says: "Usage of
> close() on file descriptors STDIN_FILENO, STDOUT_FILENO, or STDERR_FILENO
> should immediately be followed by an operation to reopen these file
> descriptors."
But this doesn't say whether you can use freopen for that purpose.
--
You are receiving this mail because:
You are on the CC list for the bug.