aboutsummaryrefslogtreecommitdiff
path: root/gdb/remote-fileio.c
diff options
context:
space:
mode:
authorMaxim Grigoriev <maxim2405@gmail.com>2007-08-10 17:49:48 +0000
committerMaxim Grigoriev <maxim2405@gmail.com>2007-08-10 17:49:48 +0000
commit9f8e69991ec013276149efa5f0f31925199fec80 (patch)
tree4294f10f95cd45ece961c23b6eb0d26cda8a5a15 /gdb/remote-fileio.c
parent271a27b8c3a6710ddf134bd0dca6482662751b30 (diff)
downloadgdb-9f8e69991ec013276149efa5f0f31925199fec80.zip
gdb-9f8e69991ec013276149efa5f0f31925199fec80.tar.gz
gdb-9f8e69991ec013276149efa5f0f31925199fec80.tar.bz2
2007-08-10 Maxim Grigoriev <maxim2405@gmail.com>
* remote-fileio.c (remote_fileio_resize_fd_map): Initialize newly allocated file descriptors.
Diffstat (limited to 'gdb/remote-fileio.c')
-rw-r--r--gdb/remote-fileio.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/gdb/remote-fileio.c b/gdb/remote-fileio.c
index 42c915b..2f165e2 100644
--- a/gdb/remote-fileio.c
+++ b/gdb/remote-fileio.c
@@ -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;
}