From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 27900 invoked by alias); 20 Oct 2009 20:05:21 -0000 Received: (qmail 27808 invoked by uid 22791); 20 Oct 2009 20:05:20 -0000 X-SWARE-Spam-Status: No, hits=-2.4 required=5.0 tests=AWL,BAYES_00 X-Spam-Check-By: sourceware.org Received: from smtp-outbound-1.vmware.com (HELO smtp-outbound-1.vmware.com) (65.115.85.69) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 20 Oct 2009 20:05:15 +0000 Received: from mailhost3.vmware.com (mailhost3.vmware.com [10.16.27.45]) by smtp-outbound-1.vmware.com (Postfix) with ESMTP id 2E0B51303C; Tue, 20 Oct 2009 13:05:14 -0700 (PDT) Received: from [10.20.94.141] (msnyder-server.eng.vmware.com [10.20.94.141]) by mailhost3.vmware.com (Postfix) with ESMTP id 21D4BCD9F0; Tue, 20 Oct 2009 13:05:14 -0700 (PDT) Message-ID: <4ADE167F.2020309@vmware.com> Date: Tue, 20 Oct 2009 20:05:00 -0000 From: Michael Snyder User-Agent: Thunderbird 1.5.0.12 (X11/20080411) MIME-Version: 1.0 To: Michael Snyder CC: Hui Zhu , Eli Zaretskii , "gdb-patches@sourceware.org" Subject: Re: [RFA, 3 of 3] save/restore process record, part 3 (save/restore) References: <4AD91D72.1030802@vmware.com> <831vl2ifui.fsf@gnu.org> <4ADA0EB3.60104@vmware.com> <83my3phjew.fsf@gnu.org> <4ADA4191.4060404@vmware.com> <83k4ytgxh5.fsf@gnu.org> <4ADA93C9.5040601@vmware.com> <4ADCA7DC.5040006@vmware.com> <4ADE1612.9040708@vmware.com> In-Reply-To: <4ADE1612.9040708@vmware.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-IsSubscribed: yes Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2009-10/txt/msg00478.txt.bz2 Michael Snyder wrote: > Hui Zhu wrote: >> On Tue, Oct 20, 2009 at 01:54, Michael Snyder wrote: >>> Hui Zhu wrote: >>>> Hi Michael, >>>> >>>> I think you want unlink the gdb_record when save get some error. It >>>> maybe need "discard_cleanups" the old_cleanups and bfd_close (obfd); >>>> >>>> After change the code, everything is OK. >>> Yes. Thanks. Like this: >>> + if (record_list->prev) >>> + record_list = record_list->prev; >>> + } >>> + >>> + do_cleanups (set_cleanups); >>> + bfd_close (obfd); >>> + discard_cleanups (old_cleanups); >>> + >>> + /* Succeeded. */ >> >> I suggest: >> + discard_cleanups (old_cleanups); >> + bfd_close (obfd); > > The reason I did the bfd_close first is because I wasn't > sure if it was safe to delete the file first. In any way, > it seems more logical to close the file before delete it. Oh, oops, never mind. My head's fuzzy today. Why do you suggest to change the order? Just curious, I don't have an issue with it...