56 |
#include <string.h> |
#include <string.h> |
57 |
#endif |
#endif |
58 |
|
|
59 |
#ifndef HAVE_DECL_ERRNO |
#if !HAVE_DECL_ERRNO |
60 |
extern int errno; |
extern int errno; |
61 |
#endif |
#endif |
62 |
|
|
113 |
|
|
114 |
/* Set information in new entry. */ |
/* Set information in new entry. */ |
115 |
bzero (&ut, sizeof (ut)); |
bzero (&ut, sizeof (ut)); |
116 |
#ifdef HAVE_UTMP_UT_TYPE |
#ifdef HAVE_STRUCT_UTMP_UT_TYPE |
117 |
ut.ut_type = USER_PROCESS; |
ut.ut_type = USER_PROCESS; |
118 |
#endif |
#endif |
119 |
strncpy (ut.ut_line, line, sizeof ut.ut_line); |
strncpy (ut.ut_line, line, sizeof ut.ut_line); |
120 |
strncpy (ut.ut_name, name, sizeof ut.ut_name); |
strncpy (ut.ut_name, name, sizeof ut.ut_name); |
121 |
#ifdef HAVE_UTMP_UT_HOST |
#ifdef HAVE_STRUCT_UTMP_UT_HOST |
122 |
strncpy (ut.ut_host, host, sizeof ut.ut_host); |
strncpy (ut.ut_host, host, sizeof ut.ut_host); |
123 |
#endif |
#endif |
124 |
|
|
125 |
#ifdef HAVE_UTMP_UT_TV |
#ifdef HAVE_STRUCT_UTMP_UT_TV |
126 |
gettimeofday (&ut.ut_tv, NULL); |
gettimeofday (&ut.ut_tv, NULL); |
127 |
#else |
#else |
128 |
time (&ut.ut_time); |
time (&ut.ut_time); |