From owner-cvs-src@FreeBSD.ORG Mon Oct 16 14:32:01 2006 Return-Path: X-Original-To: cvs-src@FreeBSD.org Delivered-To: cvs-src@FreeBSD.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id CA69B16A407; Mon, 16 Oct 2006 14:32:01 +0000 (UTC) (envelope-from ache@FreeBSD.org) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 2FC1543D4C; Mon, 16 Oct 2006 14:31:57 +0000 (GMT) (envelope-from ache@FreeBSD.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.6/8.13.6) with ESMTP id k9GEVvpP091871; Mon, 16 Oct 2006 14:31:57 GMT (envelope-from ache@repoman.freebsd.org) Received: (from ache@localhost) by repoman.freebsd.org (8.13.6/8.13.4/Submit) id k9GEVuaM091870; Mon, 16 Oct 2006 14:31:56 GMT (envelope-from ache) Message-Id: <200610161431.k9GEVuaM091870@repoman.freebsd.org> From: "Andrey A. Chernov" Date: Mon, 16 Oct 2006 14:31:56 +0000 (UTC) To: src-committers@FreeBSD.org, cvs-src@FreeBSD.org, cvs-all@FreeBSD.org X-FreeBSD-CVS-Branch: HEAD Cc: Subject: cvs commit: src/lib/libc/stdio freopen.c X-BeenThere: cvs-src@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: CVS commit messages for the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Oct 2006 14:32:01 -0000 ache 2006-10-16 14:31:56 UTC FreeBSD src repository Modified files: lib/libc/stdio freopen.c Log: file == NULL: Issue __sflush() before possible setting O_APPEND mode or ftruncate(), write to wrong place may occurse oserwise. Use simplified _sseek() to the start, if no O_APPEND is set, instead of _fseeko() (_sseek() to the end, if O_APPEND, occurse later, as for file != NULL). Don't check seek error return, as original fopen() and freopen() never does. file != NULL: Add missing _sseek() to the end. Revision Changes Path 1.17 +14 -9 src/lib/libc/stdio/freopen.c