public inbox for glibc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "lizhijian at cn dot fujitsu.com" <sourceware-bugzilla@sourceware.org>
To: glibc-bugs@sourceware.org
Subject: [Bug libc/15589] freopen would close oldfd even though oldfd is same as newfd
Date: Thu, 06 Jun 2013 05:56:00 -0000	[thread overview]
Message-ID: <bug-15589-131-U539tDbz2G@http.sourceware.org/bugzilla/> (raw)
In-Reply-To: <bug-15589-131@http.sourceware.org/bugzilla/>

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain; charset="UTF-8", Size: 3011 bytes --]

http://sourceware.org/bugzilla/show_bug.cgi?id=15589

--- Comment #2 from lizhijian <lizhijian at cn dot fujitsu.com> ---

> # ./freopen-test
> [E+] freopen error(No such file or directory)
> [S+] stat return error(Bad file descriptor)
> [E+] freopen return error(No such file or directory)
> 
sorry ,make some miss,forget to create testfile.
# touch file1 file2
test ouput as follows(glibc=2.16):
# ./freopen-test
[S+] close stdin
[S+] stat return error(Bad file descriptor)
[E+] freopen return success, but the newfd was closed

-- 
You are receiving this mail because:
You are on the CC list for the bug.
>From glibc-bugs-return-18859-listarch-glibc-bugs=sources.redhat.com@sourceware.org Thu Jun 06 06:23:44 2013
Return-Path: <glibc-bugs-return-18859-listarch-glibc-bugs=sources.redhat.com@sourceware.org>
Delivered-To: listarch-glibc-bugs@sources.redhat.com
Received: (qmail 26990 invoked by alias); 6 Jun 2013 06:23:44 -0000
Mailing-List: contact glibc-bugs-help@sourceware.org; run by ezmlm
Precedence: bulk
List-Id: <glibc-bugs.sourceware.org>
List-Subscribe: <mailto:glibc-bugs-subscribe@sourceware.org>
List-Post: <mailto:glibc-bugs@sourceware.org>
List-Help: <mailto:glibc-bugs-help@sourceware.org>, <http://sourceware.org/lists.html#faqs>
Sender: glibc-bugs-owner@sourceware.org
Delivered-To: mailing list glibc-bugs@sourceware.org
Received: (qmail 26956 invoked by uid 48); 6 Jun 2013 06:23:38 -0000
From: "lizhijian at cn dot fujitsu.com" <sourceware-bugzilla@sourceware.org>
To: glibc-bugs@sourceware.org
Subject: [Bug libc/15589] freopen would close oldfd even though oldfd is same as newfd
Date: Thu, 06 Jun 2013 06:23:00 -0000
X-Bugzilla-Reason: CC
X-Bugzilla-Type: changed
X-Bugzilla-Watch-Reason: None
X-Bugzilla-Product: glibc
X-Bugzilla-Component: libc
X-Bugzilla-Version: 2.16
X-Bugzilla-Keywords:
X-Bugzilla-Severity: normal
X-Bugzilla-Who: lizhijian at cn dot fujitsu.com
X-Bugzilla-Status: NEW
X-Bugzilla-Priority: P2
X-Bugzilla-Assigned-To: unassigned at sourceware dot org
X-Bugzilla-Target-Milestone: ---
X-Bugzilla-Flags:
X-Bugzilla-Changed-Fields: attachments.created
Message-ID: <bug-15589-131-jx9C04nWL3@http.sourceware.org/bugzilla/>
In-Reply-To: <bug-15589-131@http.sourceware.org/bugzilla/>
References: <bug-15589-131@http.sourceware.org/bugzilla/>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 7bit
X-Bugzilla-URL: http://sourceware.org/bugzilla/
Auto-Submitted: auto-generated
MIME-Version: 1.0
X-SW-Source: 2013-06/txt/msg00038.txt.bz2
Content-length: 418

http://sourceware.org/bugzilla/show_bug.cgi?id\x15589

--- Comment #3 from lizhijian <lizhijian at cn dot fujitsu.com> ---
Created attachment 7059
  --> http://sourceware.org/bugzilla/attachment.cgi?idp59&actioníit
patch for freopen

When newfd is same as oldfd, __dup3 return -1 and set errno EINVAL
In this case, it don't close oldfd

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


  parent reply	other threads:[~2013-06-06  5:56 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-06-06  5:50 [Bug libc/15589] New: " lizhijian at cn dot fujitsu.com
2013-06-06  5:53 ` [Bug libc/15589] " lizhijian at cn dot fujitsu.com
2013-06-06  5:56 ` lizhijian at cn dot fujitsu.com [this message]
2013-06-14  4:03 ` lizhijian at cn dot fujitsu.com
2014-06-13 15:10 ` fweimer at redhat dot com
2015-08-22 20:36 ` [Bug stdio/15589] " jsm28 at gcc dot gnu.org

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bug-15589-131-U539tDbz2G@http.sourceware.org/bugzilla/ \
    --to=sourceware-bugzilla@sourceware.org \
    --cc=glibc-bugs@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).