From: Michael Snyder <msnyder@vmware.com>
To: gdb-patches@sourceware.org
Subject: Re: [rfa] remote-fileio.c, remote_fileio_func_fstat, uninitialized st.st_ino.
Date: Thu, 03 Mar 2011 18:36:00 -0000 [thread overview]
Message-ID: <4D6FDF91.8010101@vmware.com> (raw)
In-Reply-To: <20110303173458.GB16894@calimero.vinschen.de>
Corinna Vinschen wrote:
> On Mar 3 09:21, Michael Snyder wrote:
>> Corinna Vinschen wrote:
>>> On Mar 3 10:04, Pedro Alves wrote:
>>>> Can't we just memset `st' instead?
>>> That would be the simplest solution. Afterwards, just set the
>>> non-zero fields.
>> OK, how about this?
>>
>
>> 2011-03-03 Michael Snyder <...>
>>
>> * remote-fileio.c (remote_fileio_func_fstat): Initialize all
>> fields of struct 'st' to zero.
>>
>> 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 3 Mar 2011 17:20:06 -0000
>> @@ -1173,20 +1173,15 @@ remote_fileio_func_fstat (char *buf)
>> if (fd == FIO_FD_CONSOLE_IN || fd == FIO_FD_CONSOLE_OUT)
>> {
>> 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_nlink = 1;
>> #ifdef HAVE_GETUID
>> st.st_uid = getuid ();
>> -#else
>> - st.st_uid = 0;
>> #endif
>> #ifdef HAVE_GETGID
>> st.st_gid = getgid ();
>> -#else
>> - st.st_gid = 0;
>> #endif
>> - st.st_rdev = 0;
>> - st.st_size = 0;
>> #ifdef HAVE_STRUCT_STAT_ST_BLKSIZE
>> st.st_blksize = 512;
>> #endif
>
> Perfect.
>
> Thanks,
> Corinna
>
Committed.
Thanks,
Michael
prev parent reply other threads:[~2011-03-03 18:36 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-03-02 21:49 Michael Snyder
2011-03-03 4:37 ` Joel Brobecker
2011-03-03 8:29 ` Corinna Vinschen
2011-03-03 9:25 ` Joel Brobecker
2011-03-03 10:04 ` Pedro Alves
2011-03-03 10:51 ` Corinna Vinschen
2011-03-03 17:22 ` Michael Snyder
2011-03-03 17:35 ` Corinna Vinschen
2011-03-03 18:36 ` Michael Snyder [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4D6FDF91.8010101@vmware.com \
--to=msnyder@vmware.com \
--cc=gdb-patches@sourceware.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox