Lines Matching refs:ut
32 struct utmp ut;
42 while ((n = safe_read(file, (void*)&ut, sizeof(struct utmp))) != 0) {
48 if (ut.ut_line[0] == '~') {
49 if (strncmp(ut.ut_user, "shutdown", 8) == 0)
50 ut.ut_type = SHUTDOWN_TIME;
51 else if (strncmp(ut.ut_user, "reboot", 6) == 0)
52 ut.ut_type = BOOT_TIME;
53 else if (strncmp(ut.ut_user, "runlevel", 7) == 0)
54 ut.ut_type = RUN_LVL;
56 if (!ut.ut_name[0] || strcmp(ut.ut_name, "LOGIN") == 0 ||
57 ut.ut_name[0] == 0)
63 if (ut.ut_type != DEAD_PROCESS &&
64 ut.ut_name[0] && ut.ut_line[0])
66 ut.ut_type = USER_PROCESS;
68 if (strcmp(ut.ut_name, "date") == 0) {
69 if (ut.ut_line[0] == '|') ut.ut_type = OLD_TIME;
70 if (ut.ut_line[0] == '{') ut.ut_type = NEW_TIME;
74 if (ut.ut_type!=USER_PROCESS) {
75 switch (ut.ut_type) {
82 strcpy(ut.ut_line, "system boot");
86 t_tmp = (time_t)ut.ut_tv.tv_sec;
87 printf("%-10s %-14s %-18s %-12.12s\n", ut.ut_user, ut.ut_line, ut.ut_host,