mirror of
https://git.savannah.gnu.org/git/coreutils.git
synced 2026-11-19 03:33:43 +03:00
who: avoid locking standard output for each user with the -q option
* src/who (list_entries_who): Prefer putchar and fputs to printf. Simplify separator tracking.
This commit is contained in:
1 parent
c8b296683f
commit
eec7b2a131
1 file changed
+3
-3
@@ -525,7 +525,6 @@ static void
|
||||
list_entries_who (idx_t n, STRUCT_UTMP const *utmp_buf)
|
||||
{
|
||||
idx_t entries = 0;
|
||||
char const *separator = "";
|
||||
|
||||
while (n--)
|
||||
{
|
||||
@@ -535,9 +534,10 @@ list_entries_who (idx_t n, STRUCT_UTMP const *utmp_buf)
|
||||
|
||||
trimmed_name = extract_trimmed_name (utmp_buf);
|
||||
|
||||
printf ("%s%s", separator, trimmed_name);
|
||||
if (entries)
|
||||
putchar (' ');
|
||||
fputs (trimmed_name, stdout);
|
||||
free (trimmed_name);
|
||||
separator = " ";
|
||||
entries++;
|
||||
}
|
||||
utmp_buf++;
|
||||
|
||||
Reference in new issue
Block a user