… | |
… | |
35 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. |
35 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. |
36 | *----------------------------------------------------------------------*/ |
36 | *----------------------------------------------------------------------*/ |
37 | |
37 | |
38 | #include "../config.h" |
38 | #include "../config.h" |
39 | |
39 | |
|
|
40 | #include "ptytty.h" |
|
|
41 | |
|
|
42 | #if UTMP_SUPPORT |
|
|
43 | |
40 | #include <cstdio> |
44 | #include <cstdio> |
41 | |
45 | |
42 | #include <sys/types.h> |
46 | #include <sys/types.h> |
43 | #include <sys/stat.h> |
47 | #include <sys/stat.h> |
44 | #include <sys/fcntl.h> |
48 | #include <sys/fcntl.h> |
45 | #include <unistd.h> |
49 | #include <unistd.h> |
46 | #include <time.h> |
50 | #include <time.h> |
47 | |
|
|
48 | #include "ptytty.h" |
|
|
49 | |
|
|
50 | #if UTMP_SUPPORT |
|
|
51 | |
51 | |
52 | #if HAVE_STRUCT_UTMP |
52 | #if HAVE_STRUCT_UTMP |
53 | static int write_bsd_utmp (int utmp_pos, struct utmp *wu); |
53 | static int write_bsd_utmp (int utmp_pos, struct utmp *wu); |
54 | static void update_wtmp (const char *fname, const struct utmp *putmp); |
54 | static void update_wtmp (const char *fname, const struct utmp *putmp); |
55 | #endif |
55 | #endif |
… | |
… | |
426 | |
426 | |
427 | # ifdef HAVE_STRUCT_LASTLOG |
427 | # ifdef HAVE_STRUCT_LASTLOG |
428 | pwent = getpwuid (getuid ()); |
428 | pwent = getpwuid (getuid ()); |
429 | if (!pwent) |
429 | if (!pwent) |
430 | { |
430 | { |
431 | ptytty_warn ("no entry in password file, not updating lastlog.\n"); |
431 | ptytty_warn ("no entry in password file, not updating lastlog.\n", 0); |
432 | return; |
432 | return; |
433 | } |
433 | } |
434 | |
434 | |
435 | memset (&ll, 0, sizeof (ll)); |
435 | memset (&ll, 0, sizeof (ll)); |
436 | ll.ll_time = time (NULL); |
436 | ll.ll_time = time (NULL); |