summaryrefslogtreecommitdiff
path: root/gdb/remote-fileio.c
diff options
context:
space:
mode:
authorNathan Sidwell <nathan@codesourcery.com>2006-06-08 19:08:22 +0000
committerNathan Sidwell <nathan@codesourcery.com>2006-06-08 19:08:22 +0000
commit88944d6e33760105b06e87e138d7ca3cbc2dd0e2 (patch)
tree3e14e2561fbb695e26186fbcd6e2f9998ffdaa12 /gdb/remote-fileio.c
parent9d72082009a458c1d4a8ab4ce5c11454c4cb635c (diff)
downloadgdb-88944d6e33760105b06e87e138d7ca3cbc2dd0e2.tar.gz
* remote-fileio.c (remote_fileio_reset): New.
* remote-fileio.h (remote_fileio_reset): Prototype. * remote.c (extended_remote_restart, remote_open_1): Call it.
Diffstat (limited to 'gdb/remote-fileio.c')
-rw-r--r--gdb/remote-fileio.c22
1 files changed, 22 insertions, 0 deletions
diff --git a/gdb/remote-fileio.c b/gdb/remote-fileio.c
index 7056a34e51b..d445d40ac18 100644
--- a/gdb/remote-fileio.c
+++ b/gdb/remote-fileio.c
@@ -1355,6 +1355,28 @@ do_remote_fileio_request (struct ui_out *uiout, void *buf_arg)
return 0;
}
+/* Close any open descriptors, and reinitialize the file mapping. */
+
+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);
+ }
+ if (remote_fio_data.fd_map)
+ {
+ free (remote_fio_data.fd_map);
+ remote_fio_data.fd_map = NULL;
+ remote_fio_data.fd_map_size = 0;
+ }
+}
+
void
remote_fileio_request (char *buf)
{