From owner-freebsd-bugs Sun Jun 16 12:40:18 2002 Delivered-To: freebsd-bugs@hub.freebsd.org Received: from freefall.freebsd.org (freefall.FreeBSD.org [216.136.204.21]) by hub.freebsd.org (Postfix) with ESMTP id 3D89537B435 for ; Sun, 16 Jun 2002 12:40:02 -0700 (PDT) Received: (from gnats@localhost) by freefall.freebsd.org (8.11.6/8.11.6) id g5GJe1e33684; Sun, 16 Jun 2002 12:40:01 -0700 (PDT) (envelope-from gnats) Received: from nwww.freebsd.org (www.FreeBSD.org [216.136.204.117]) by hub.freebsd.org (Postfix) with ESMTP id 12CD637B42A for ; Sun, 16 Jun 2002 12:38:04 -0700 (PDT) Received: from www.freebsd.org (localhost [127.0.0.1]) by nwww.freebsd.org (8.12.2/8.12.2) with ESMTP id g5GJc3hG001333 for ; Sun, 16 Jun 2002 12:38:03 -0700 (PDT) (envelope-from nobody@www.freebsd.org) Received: (from nobody@localhost) by www.freebsd.org (8.12.2/8.12.2/Submit) id g5GJc371001332; Sun, 16 Jun 2002 12:38:03 -0700 (PDT) Message-Id: <200206161938.g5GJc371001332@www.freebsd.org> Date: Sun, 16 Jun 2002 12:38:03 -0700 (PDT) From: Kahmyong Moon To: freebsd-gnats-submit@FreeBSD.org X-Send-Pr-Version: www-1.0 Subject: misc/39377: freopen() in libc_r does not append Sender: owner-freebsd-bugs@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org >Number: 39377 >Category: misc >Synopsis: freopen() in libc_r does not append >Confidential: no >Severity: critical >Priority: high >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Sun Jun 16 12:40:01 PDT 2002 >Closed-Date: >Last-Modified: >Originator: Kahmyong Moon >Release: 4.6 >Organization: >Environment: FreeBSD wormwood 4.6-RELEASE FreeBSD 4.6-RELEASE #0: Tue Jun 11 06:14 :12 GMT 2002 murray@builder.freebsdmall.com:/usr/src/sys/compile/GENERIC i3 86 >Description: When compiling with libc_r, freopen() (and possibly others) do not start writing from the end of the file, but at the beginning, overwriting data. A workaround is to fseek() to the end first. Reopening standard streams may be a factor, but I don't believe so. >How-To-Repeat: A simple example: freopen("err.log", "a", stderr); setvbuf(stderr, NULL, _IOLBF, BUFSIZ); fputs("LOGGING INITIATIED\n", stderr); >Fix: The freopen() in libc works. Only the version in libc_r seems to be defective. A fix would probably be easy enough. Do note that I've only performed one specific test, and would not be surprised if the other fopen() functions were also defective with regards to append in libc_r. >Release-Note: >Audit-Trail: >Unformatted: To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-bugs" in the body of the message