From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 6079 invoked by alias); 17 Jun 2006 20:07:09 -0000 Received: (qmail 5818 invoked by uid 22791); 17 Jun 2006 20:07:08 -0000 X-Spam-Check-By: sourceware.org Received: from sibelius.xs4all.nl (HELO sibelius.xs4all.nl) (82.92.89.47) by sourceware.org (qpsmtpd/0.31) with ESMTP; Sat, 17 Jun 2006 20:07:05 +0000 Received: from elgar.sibelius.xs4all.nl (root@elgar.sibelius.xs4all.nl [192.168.0.2]) by sibelius.xs4all.nl (8.13.4/8.13.4) with ESMTP id k5HK4Ucg003287; Sat, 17 Jun 2006 22:04:30 +0200 (CEST) Received: from elgar.sibelius.xs4all.nl (kettenis@localhost.sibelius.xs4all.nl [127.0.0.1]) by elgar.sibelius.xs4all.nl (8.13.6/8.13.6) with ESMTP id k5HK4URE025952; Sat, 17 Jun 2006 22:04:30 +0200 (CEST) Received: (from kettenis@localhost) by elgar.sibelius.xs4all.nl (8.13.6/8.13.6/Submit) id k5HK4UI9018202; Sat, 17 Jun 2006 22:04:30 +0200 (CEST) Date: Sat, 17 Jun 2006 21:16:00 -0000 Message-Id: <200606172004.k5HK4UI9018202@elgar.sibelius.xs4all.nl> From: Mark Kettenis To: dan@codesourcery.com CC: nathan@codesourcery.com, gdb@sourceware.org In-reply-to: <20060524124120.GA25225@nevyn.them.org> (message from Daniel Jacobowitz on Wed, 24 May 2006 08:41:21 -0400) Subject: Re: reset fileio References: <4474131D.2080805@codesourcery.com> <20060524124120.GA25225@nevyn.them.org> Mailing-List: contact gdb-help@sourceware.org; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sourceware.org X-SW-Source: 2006-06/txt/msg00114.txt.bz2 > Date: Wed, 24 May 2006 08:41:21 -0400 > From: Daniel Jacobowitz > > On Wed, May 24, 2006 at 09:02:37AM +0100, Nathan Sidwell wrote: > > + /* Close any open descriptors, and reinitialize the file mapping */ > > Period at the end of the comment. > > > + void > > + remote_fileio_reset (void) > > + { > > + int ix; > > + > > + for (ix = 0; ix != remote_fio_data.fd_map_size; ix++) > > + { > > + int fd = remote_fio_data.fd_map[ix]; > > + > > + if (fd >= 0) > > + close (fd); > > + } > > + free (remote_fio_data.fd_map); > > + remote_fio_data.fd_map = NULL; > > + remote_fio_data.fd_map_size = 0; > > + } > > Won't this free NULL if the target hadn't initialized fileio? I think > that's non-portable. That's why Nathan should use xfree() instead of free(). Mark