* remote-fileio.c (remote_fileio_reset): New.
[deliverable/binutils-gdb.git] / gdb / remote-fileio.c
index 7056a34e51b577aa9667c8ee82ac339732ddfee3..d445d40ac181e2456e3983b9fc7bdab117144787 100644 (file)
@@ -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)
 {
This page took 0.024341 seconds and 4 git commands to generate.