bug-coreutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] ls: don't use an undefined struct stat after failed stat/lst


From: Eric Blake
Subject: Re: [PATCH] ls: don't use an undefined struct stat after failed stat/lstat
Date: Tue, 29 Sep 2009 05:39:42 -0600
User-agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.23) Gecko/20090812 Thunderbird/2.0.0.23 Mnenhy/0.7.6.666

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

According to Jim Meyering on 9/29/2009 5:13 AM:
> -          /* The failed stat/lstat may have modified f->stat.  Clear it,
> -             since we may use at least its st_ino member, e.g.,
> -             when trying to print the inode of dangling symlink:
> -             mkdir d; ln -s no-such d/s; ls -Li d  */
> -          memset (&f->stat, 0, sizeof (f->stat));
> +          f->stat.st_ino = 22;

Why 22?  Is this debugging leftovers?

- --
Don't work too hard, make some time for fun as well!

Eric Blake             address@hidden
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (Cygwin)
Comment: Public key at home.comcast.net/~ericblake/eblake.gpg
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAkrB8f4ACgkQ84KuGfSFAYAh0ACgrKtuS+Eg9QMsjOQAa2LrMWAm
XkQAn2rHcJzA1p22poZd0kviMH0dbKWH
=hb9Q
-----END PGP SIGNATURE-----




reply via email to

[Prev in Thread] Current Thread [Next in Thread]