2011-03-03 Michael Snyder <msnyder@vmware.com>

* remote-fileio.c (remote_fileio_func_fstat): Initialize all
	fields of struct 'st' to zero.
This commit is contained in:
Michael Snyder 2011-03-03 18:35:32 +00:00
parent 3e2a0cee55
commit 2e3fd7679d
2 changed files with 4 additions and 6 deletions

View File

@ -6,6 +6,9 @@
2011-03-03 Michael Snyder <msnyder@vmware.com> 2011-03-03 Michael Snyder <msnyder@vmware.com>
* remote-fileio.c (remote_fileio_func_fstat): Initialize all
fields of struct 'st' to zero.
* tui/tui-winsource.c (tui_update_source_window_as_is): Initialize * tui/tui-winsource.c (tui_update_source_window_as_is): Initialize
sal.pspace before calling set_current_source_symtab_and_line. sal.pspace before calling set_current_source_symtab_and_line.

View File

@ -1173,20 +1173,15 @@ remote_fileio_func_fstat (char *buf)
if (fd == FIO_FD_CONSOLE_IN || fd == FIO_FD_CONSOLE_OUT) if (fd == FIO_FD_CONSOLE_IN || fd == FIO_FD_CONSOLE_OUT)
{ {
remote_fileio_to_fio_uint (1, fst.fst_dev); remote_fileio_to_fio_uint (1, fst.fst_dev);
memset (&st, 0, sizeof (st));
st.st_mode = S_IFCHR | (fd == FIO_FD_CONSOLE_IN ? S_IRUSR : S_IWUSR); st.st_mode = S_IFCHR | (fd == FIO_FD_CONSOLE_IN ? S_IRUSR : S_IWUSR);
st.st_nlink = 1; st.st_nlink = 1;
#ifdef HAVE_GETUID #ifdef HAVE_GETUID
st.st_uid = getuid (); st.st_uid = getuid ();
#else
st.st_uid = 0;
#endif #endif
#ifdef HAVE_GETGID #ifdef HAVE_GETGID
st.st_gid = getgid (); st.st_gid = getgid ();
#else
st.st_gid = 0;
#endif #endif
st.st_rdev = 0;
st.st_size = 0;
#ifdef HAVE_STRUCT_STAT_ST_BLKSIZE #ifdef HAVE_STRUCT_STAT_ST_BLKSIZE
st.st_blksize = 512; st.st_blksize = 512;
#endif #endif