52 |
|
|
53 |
setutent (); |
setutent (); |
54 |
|
|
55 |
#ifdef HAVE_UTMP_UT_TYPE |
#ifdef HAVE_STRUCT_UTMP_UT_TYPE |
56 |
search.ut_type = USER_PROCESS; |
search.ut_type = USER_PROCESS; |
57 |
#endif |
#endif |
58 |
strncpy (search.ut_line, line, sizeof search.ut_line); |
strncpy (search.ut_line, line, sizeof search.ut_line); |
60 |
ut = getutline (&search); |
ut = getutline (&search); |
61 |
if (ut) |
if (ut) |
62 |
{ |
{ |
63 |
#ifdef HAVE_UTMP_UT_HOST |
#ifdef HAVE_STRUCT_UTMP_UT_HOST |
64 |
bzero (ut->ut_host, sizeof ut->ut_host); |
bzero (ut->ut_host, sizeof ut->ut_host); |
65 |
#endif |
#endif |
66 |
#ifdef HAVE_UTMP_UT_TV |
#ifdef HAVE_STRUCT_UTMP_UT_TV |
67 |
gettimeofday (&ut->ut_tv, NULL); |
gettimeofday (&ut->ut_tv, NULL); |
68 |
#else |
#else |
69 |
time (&ut->ut_time); |
time (&ut->ut_time); |
122 |
{ |
{ |
123 |
/* Zero out entries describing who's logged in. */ |
/* Zero out entries describing who's logged in. */ |
124 |
bzero (ut->ut_name, sizeof ut->ut_name); |
bzero (ut->ut_name, sizeof ut->ut_name); |
125 |
#ifdef HAVE_UTMP_UT_HOST |
#ifdef HAVE_STRUCT_UTMP_UT_HOST |
126 |
bzero (ut->ut_host, sizeof ut->ut_host); |
bzero (ut->ut_host, sizeof ut->ut_host); |
127 |
#endif |
#endif |
128 |
#ifdef HAVE_UTMP_UT_TV |
#ifdef HAVE_STRUCT_UTMP_UT_TV |
129 |
gettimeofday (&ut->ut_tv, NULL); |
gettimeofday (&ut->ut_tv, NULL); |
130 |
#else |
#else |
131 |
time (&ut->ut_time); |
time (&ut->ut_time); |