Date: Sun, 16 Jun 2002 12:38:03 -0700 (PDT) From: Kahmyong Moon <kahmy@uclink.berkeley.edu> To: freebsd-gnats-submit@FreeBSD.org Subject: misc/39377: freopen() in libc_r does not append Message-ID: <200206161938.g5GJc371001332@www.freebsd.org>
next in thread | raw e-mail | index | archive | help
>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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200206161938.g5GJc371001332>