This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [rfa] remote-fileio.c, remote_fileio_func_fstat, uninitialized st.st_ino.
- From: Joel Brobecker <brobecker at adacore dot com>
- To: Michael Snyder <msnyder at vmware dot com>
- Cc: "gdb-patches at sourceware dot org" <gdb-patches at sourceware dot org>, vinschen at redhat dot com
- Date: Thu, 3 Mar 2011 08:36:43 +0400
- Subject: Re: [rfa] remote-fileio.c, remote_fileio_func_fstat, uninitialized st.st_ino.
- References: <4D6EBB4A.9080207@vmware.com>
> 2011-03-02 Michael Snyder <msnyder@vmware.com>
>
> * remote-fileio.c (remote_fileio_func_fstat): Initialize st_ino
> to zero.
FWIW: The initialization is made for the case where the file descriptor
is not a file, so we should be ablet to deduce that the st_ino (inode ID)
is irrelevant and not used on the consumer side... This would suggest
that your change is correct. (you should still wait for Corinna to
comment)
> Index: remote-fileio.c
> ===================================================================
> RCS file: /cvs/src/src/gdb/remote-fileio.c,v
> retrieving revision 1.40
> diff -u -p -u -p -r1.40 remote-fileio.c
> --- remote-fileio.c 25 Jan 2011 11:54:00 -0000 1.40
> +++ remote-fileio.c 2 Mar 2011 21:41:48 -0000
> @@ -1175,6 +1175,7 @@ remote_fileio_func_fstat (char *buf)
> remote_fileio_to_fio_uint (1, fst.fst_dev);
> st.st_mode = S_IFCHR | (fd == FIO_FD_CONSOLE_IN ? S_IRUSR : S_IWUSR);
> st.st_nlink = 1;
> + st.st_ino = 0;
> #ifdef HAVE_GETUID
> st.st_uid = getuid ();
> #else
--
Joel