aboutsummaryrefslogtreecommitdiff
path: root/coreutils
diff options
context:
space:
mode:
authorvda <vda@69ca8d6d-28ef-0310-b511-8ec308f3f277>2007-01-19 21:24:17 +0000
committervda <vda@69ca8d6d-28ef-0310-b511-8ec308f3f277>2007-01-19 21:24:17 +0000
commitf772075e79d2493702a212124b8701cf265e067d (patch)
tree35b7039cf3d4fab57d1e4c69cc0bea5bc847a832 /coreutils
parent7101c9124c81ab0c4a1d93a02372a2bed8701f19 (diff)
downloadbusybox-w32-f772075e79d2493702a212124b8701cf265e067d.tar.gz
busybox-w32-f772075e79d2493702a212124b8701cf265e067d.tar.bz2
busybox-w32-f772075e79d2493702a212124b8701cf265e067d.zip
ls: use get_cached_username/groupname
git-svn-id: svn://busybox.net/trunk/busybox@17391 69ca8d6d-28ef-0310-b511-8ec308f3f277
Diffstat (limited to 'coreutils')
-rw-r--r--coreutils/ls.c14
1 files changed, 5 insertions, 9 deletions
diff --git a/coreutils/ls.c b/coreutils/ls.c
index ae28f6420..ff0831dac 100644
--- a/coreutils/ls.c
+++ b/coreutils/ls.c
@@ -291,7 +291,7 @@ static void dfree(struct dnode **dnp, int nfiles)
291 free(dnp); /* free the array holding the dnode pointers */ 291 free(dnp); /* free the array holding the dnode pointers */
292} 292}
293#else 293#else
294#define dfree(...) do {} while (0) 294#define dfree(...) ((void)0)
295#endif 295#endif
296 296
297static struct dnode **splitdnarray(struct dnode **dn, int nfiles, int which) 297static struct dnode **splitdnarray(struct dnode **dn, int nfiles, int which)
@@ -375,7 +375,7 @@ static void dnsort(struct dnode **dn, int size)
375 qsort(dn, size, sizeof(*dn), sortcmp); 375 qsort(dn, size, sizeof(*dn), sortcmp);
376} 376}
377#else 377#else
378#define dnsort(dn, size) do {} while (0) 378#define dnsort(dn, size) ((void)0)
379#endif 379#endif
380 380
381 381
@@ -541,9 +541,6 @@ static int list_single(struct dnode *dn)
541{ 541{
542 int i, column = 0; 542 int i, column = 0;
543 543
544#if ENABLE_FEATURE_LS_USERNAME
545 char scratch[16];
546#endif
547#if ENABLE_FEATURE_LS_TIMESTAMPS 544#if ENABLE_FEATURE_LS_TIMESTAMPS
548 char *filetime; 545 char *filetime;
549 time_t ttime, age; 546 time_t ttime, age;
@@ -584,10 +581,9 @@ static int list_single(struct dnode *dn)
584 break; 581 break;
585 case LIST_ID_NAME: 582 case LIST_ID_NAME:
586#if ENABLE_FEATURE_LS_USERNAME 583#if ENABLE_FEATURE_LS_USERNAME
587 bb_getpwuid(scratch, dn->dstat.st_uid, sizeof(scratch)); 584 printf("%-8.8s %-8.8s",
588 printf("%-8.8s ", scratch); 585 get_cached_username(dn->dstat.st_uid),
589 bb_getgrgid(scratch, dn->dstat.st_gid, sizeof(scratch)); 586 get_cached_groupname(dn->dstat.st_gid));
590 printf("%-8.8s", scratch);
591 column += 17; 587 column += 17;
592 break; 588 break;
593#endif 589#endif