From: Mark Kettenis <mark.kettenis@xs4all.nl>
To: dan@codesourcery.com
Cc: nathan@codesourcery.com, gdb@sourceware.org
Subject: Re: reset fileio
Date: Sat, 17 Jun 2006 21:16:00 -0000 [thread overview]
Message-ID: <200606172004.k5HK4UI9018202@elgar.sibelius.xs4all.nl> (raw)
In-Reply-To: <20060524124120.GA25225@nevyn.them.org> (message from Daniel Jacobowitz on Wed, 24 May 2006 08:41:21 -0400)
> Date: Wed, 24 May 2006 08:41:21 -0400
> From: Daniel Jacobowitz <dan@codesourcery.com>
>
> 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
prev parent reply other threads:[~2006-06-17 20:07 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-05-24 12:41 Nathan Sidwell
2006-05-24 13:06 ` Daniel Jacobowitz
2006-05-24 21:11 ` Nathan Sidwell
2006-06-17 21:16 ` Mark Kettenis [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=200606172004.k5HK4UI9018202@elgar.sibelius.xs4all.nl \
--to=mark.kettenis@xs4all.nl \
--cc=dan@codesourcery.com \
--cc=gdb@sourceware.org \
--cc=nathan@codesourcery.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox