Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe@cygwin.com>
List-Archive: <http://sources.redhat.com/ml/cygwin/>
List-Post: <mailto:cygwin@cygwin.com>
List-Help: <mailto:cygwin-help@cygwin.com>, <http://sources.redhat.com/ml/#faqs>
Sender: cygwin-owner@cygwin.com
Mail-Followup-To: cygwin@cygwin.com
Delivered-To: mailing list cygwin@cygwin.com
Message-ID: <031401c2b34f$67eb5720$9783883e@pomello>
From: "Max Bowsher" <maxb@ukf.net>
To: "Robert Mecklenburg" <mecklen@cimsoft.com>, <bonzini@gnu.org>
Cc: "Cygwin Users List" <cygwin@cygwin.com>
References: <200301031627.h03GRTRQ020947@wolf.cimsoft.com>
Subject: Re: sed -i problem?
Date: Fri, 3 Jan 2003 17:16:35 -0000
MIME-Version: 1.0
Content-Type: text/plain;
	charset="iso-8859-1"
Content-Transfer-Encoding: 7bit
X-Priority: 3
X-MSMail-Priority: Normal
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1106

Robert Mecklenburg wrote:
> I seem to be having problem with the -i flag in sed 4.0.1 in the
> latest cygwin release.  The docs state -i places output in a tmp file
> and renames the tmp to the original when finished.  It appears the
> rename is not happening for me:
[snip example]

I did a quick bit of strace-ing, and it seems that sed isn't closing the
input and output files before doing the rename. Unsurprisingly, this fails
with "Access is denied.".

But sed is trying to close the files. It gets as far as
lib/utils.c:ck_fclose(stream), but then it does something complicated with a
linked list, and ends up never calling do_ck_fclose(), which would actually
call fclose().

Right, I've got no more time now, so hopefully someone else will take my
analysis, and finish tracking down this bug.

Max.



--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Bug reporting:         http://cygwin.com/bugs.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

