From 9f8e69991ec013276149efa5f0f31925199fec80 Mon Sep 17 00:00:00 2001 From: Maxim Grigoriev Date: Fri, 10 Aug 2007 17:49:48 +0000 Subject: [PATCH] 2007-08-10 Maxim Grigoriev * remote-fileio.c (remote_fileio_resize_fd_map): Initialize newly allocated file descriptors. --- gdb/ChangeLog | 5 +++++ gdb/remote-fileio.c | 4 ++++ 2 files changed, 9 insertions(+) diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 1ea9408bdd3..be4366dc723 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,8 @@ +2007-08-09 Maxim Grigoriev + + * remote-fileio.c (remote_fileio_resize_fd_map): Initialize newly + allocated file descriptors. + 2007-08-10 Joel Brobecker * Makefile.in: Minor cleanup throughout; add some missing variables, diff --git a/gdb/remote-fileio.c b/gdb/remote-fileio.c index 42c915bf96a..2f165e21f3e 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; } -- 2.30.2