2007-08-10 Maxim Grigoriev <maxim2405@gmail.com>
authorMaxim Grigoriev <maxim2405@gmail.com>
Fri, 10 Aug 2007 17:49:48 +0000 (17:49 +0000)
committerMaxim Grigoriev <maxim2405@gmail.com>
Fri, 10 Aug 2007 17:49:48 +0000 (17:49 +0000)
* remote-fileio.c (remote_fileio_resize_fd_map): Initialize newly
allocated file descriptors.

gdb/ChangeLog
gdb/remote-fileio.c

index 1ea9408bdd3bed95aa745244f8911a10227e6f9c..be4366dc72360ff9cd8c29ac7f4de99796323fde 100644 (file)
@@ -1,3 +1,8 @@
+2007-08-09  Maxim Grigoriev  <maxim2405@gmail.com>
+
+       * remote-fileio.c (remote_fileio_resize_fd_map): Initialize newly
+       allocated file descriptors.
+
 2007-08-10  Joel Brobecker  <brobecker@adacore.com>
 
        * Makefile.in: Minor cleanup throughout; add some missing variables,
index 42c915bf96a268c365dbccc03da5b9ec41b4731f..2f165e21f3e1f1840bc61039a7eb2d0a513dd78e 100644 (file)
@@ -70,12 +70,16 @@ remote_fileio_init_fd_map (void)
 static int
 remote_fileio_resize_fd_map (void)
 {
+  int i = remote_fio_data.fd_map_size;
+
   if (!remote_fio_data.fd_map)
     return remote_fileio_init_fd_map ();
   remote_fio_data.fd_map_size += 10;
   remote_fio_data.fd_map =
     (int *) xrealloc (remote_fio_data.fd_map,
                      remote_fio_data.fd_map_size * sizeof (int));
+  for (; i < remote_fio_data.fd_map_size; i++)
+    remote_fio_data.fd_map[i] = FIO_FD_INVALID;
   return remote_fio_data.fd_map_size - 10;
 }