| 330 | /* Print the name or value of user ID UID. */ |
| 331 | |
| 332 | static void |
| 333 | print_user (uid_t uid) |
| 334 | { |
| 335 | struct passwd *pwd = NULL; |
| 336 | |
| 337 | if (use_name) |
| 338 | { |
| 339 | pwd = getpwuid (uid); |
| 340 | if (pwd == NULL) |
| 341 | { |
| 342 | error (0, 0, _("cannot find name for user ID %ju"), (uintmax_t) uid); |
| 343 | ok &= false; |
| 344 | } |
| 345 | } |
| 346 | |
| 347 | if (pwd) |
| 348 | printf ("%s", pwd->pw_name); |
| 349 | else |
| 350 | printf ("%ju", (uintmax_t) uid); |
| 351 | } |
| 352 | |
| 353 | /* Print all of the info about the user's user and group IDs. */ |
| 354 |