MCPcopy Create free account
hub / github.com/coreutils/coreutils / print_deadprocs

Function print_deadprocs

src/who.c:446–467  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

444}
445
446static void
447print_deadprocs (STRUCT_UTMP const *utmp_ent)
448{
449 static char *exitstr;
450 char *comment = make_id_equals_comment (utmp_ent);
451 PIDSTR_DECL_AND_INIT (pidstr, utmp_ent);
452
453 if (!exitstr)
454 exitstr = xmalloc (strlen (_("term="))
455 + INT_STRLEN_BOUND (utmp_ent->ut_exit.e_termination) + 1
456 + strlen (_("exit="))
457 + INT_STRLEN_BOUND (utmp_ent->ut_exit.e_exit)
458 + 1);
459 sprintf (exitstr, "%s%d %s%d", _("term="), utmp_ent->ut_exit.e_termination,
460 _("exit="), utmp_ent->ut_exit.e_exit);
461
462 /* FIXME: add idle time? */
463
464 print_line ("", ' ', utmp_ent->ut_line,
465 time_string (utmp_ent), "", pidstr, comment, exitstr);
466 free (comment);
467}
468
469static void
470print_login (STRUCT_UTMP const *utmp_ent)

Callers 1

scan_entriesFunction · 0.85

Calls 3

make_id_equals_commentFunction · 0.85
print_lineFunction · 0.70
time_stringFunction · 0.70

Tested by

no test coverage detected