This is the mail archive of the
gdb@sourceware.org
mailing list for the GDB project.
Re: reset fileio
- From: Daniel Jacobowitz <dan at codesourcery dot com>
- To: Nathan Sidwell <nathan at codesourcery dot com>
- Cc: gdb at sourceware dot org
- Date: Wed, 24 May 2006 08:41:21 -0400
- Subject: Re: reset fileio
- References: <4474131D.2080805@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.
--
Daniel Jacobowitz
CodeSourcery