53 |
#endif |
#endif |
54 |
|
|
55 |
memset((char *) &utx, 0, sizeof(utx)); |
memset((char *) &utx, 0, sizeof(utx)); |
56 |
|
#if defined(HAVE_UTMP_UT_ID) |
57 |
strncpy(utx.ut_id, id, sizeof(utx.ut_id)); |
strncpy(utx.ut_id, id, sizeof(utx.ut_id)); |
58 |
|
#endif |
59 |
|
#if defined(HAVE_UTMP_UT_USER) |
60 |
strncpy(utx.ut_user, user, sizeof(utx.ut_user)); |
strncpy(utx.ut_user, user, sizeof(utx.ut_user)); |
61 |
|
#else |
62 |
|
strncpy(utx.ut_name, user, sizeof(utx.ut_name)); |
63 |
|
#endif |
64 |
strncpy(utx.ut_line, line, sizeof(utx.ut_line)); |
strncpy(utx.ut_line, line, sizeof(utx.ut_line)); |
65 |
|
#if defined(HAVE_UTMP_UT_PID) |
66 |
utx.ut_pid = getpid(); |
utx.ut_pid = getpid(); |
67 |
|
#endif |
68 |
|
#if defined(HAVE_UTMP_UT_TYPE) |
69 |
utx.ut_type = LOGIN_PROCESS; |
utx.ut_type = LOGIN_PROCESS; |
70 |
|
#endif |
71 |
#if defined(HAVE_UTMPX_UT_TV) |
#if defined(HAVE_UTMPX_UT_TV) |
72 |
gettimeofday(&(utx.ut_tv), 0); |
gettimeofday(&(utx.ut_tv), 0); |
73 |
#else |
#else |