diff options
author | Paul Eggert <eggert@cs.ucla.edu> | 2013-05-24 10:21:26 -0700 |
---|---|---|
committer | Paul Eggert <eggert@cs.ucla.edu> | 2013-05-24 10:21:51 -0700 |
commit | 23356b02f28aa88b08dc9d9bebdd07fd6090ea6b (patch) | |
tree | befda05bcab94c0154c458caf505244b5560e09e /src | |
parent | fec363cebf581ef27f6d01686dec5a0499aa6818 (diff) | |
download | coreutils-23356b02f28aa88b08dc9d9bebdd07fd6090ea6b.tar.xz |
stat: tune for large-LDAP case
* src/stat.c (print_stat): Omit unnecessary calls to setpwent, setgrent.
Problem reported by FridolĂn PokornĂ˝ in <http://bugs.gnu.org/14462>.
Diffstat (limited to 'src')
-rw-r--r-- | src/stat.c | 2 |
1 files changed, 0 insertions, 2 deletions
diff --git a/src/stat.c b/src/stat.c index a1d558ce1..947bc31e0 100644 --- a/src/stat.c +++ b/src/stat.c @@ -965,7 +965,6 @@ print_stat (char *pformat, size_t prefix_len, unsigned int m, out_uint (pformat, prefix_len, statbuf->st_uid); break; case 'U': - setpwent (); pw_ent = getpwuid (statbuf->st_uid); out_string (pformat, prefix_len, pw_ent ? pw_ent->pw_name : "UNKNOWN"); @@ -974,7 +973,6 @@ print_stat (char *pformat, size_t prefix_len, unsigned int m, out_uint (pformat, prefix_len, statbuf->st_gid); break; case 'G': - setgrent (); gw_ent = getgrgid (statbuf->st_gid); out_string (pformat, prefix_len, gw_ent ? gw_ent->gr_name : "UNKNOWN"); |