ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/rxvt-unicode/src/logging.C
(Generate patch)

Comparing rxvt-unicode/src/logging.C (file contents):
Revision 1.39 by root, Sun Jan 22 12:21:47 2006 UTC vs.
Revision 1.41 by root, Wed Jan 25 11:16:09 2006 UTC

16 * Copyright (c) 1998-2001 Geoff Wing <gcw@pobox.com> 16 * Copyright (c) 1998-2001 Geoff Wing <gcw@pobox.com>
17 * - extensive modifications 17 * - extensive modifications
18 * Copyright (c) 1999 D J Hawkey Jr <hawkeyd@visi.com> 18 * Copyright (c) 1999 D J Hawkey Jr <hawkeyd@visi.com>
19 * - lastlog support 19 * - lastlog support
20 * Copyright (c) 2004-2006 Marc Lehmann <pcg@goof.com> 20 * Copyright (c) 2004-2006 Marc Lehmann <pcg@goof.com>
21 * Copyright (c) 2006 Emanuele Giaquinta <e.giaquinta@glauco.it> 21 * Copyright (c) 2006 Emanuele Giaquinta <e.giaquinta@glauco.it>
22 * 22 *
23 * This program is free software; you can redistribute it and/or modify 23 * This program is free software; you can redistribute it and/or modify
24 * it under the terms of the GNU General Public License as published by 24 * it under the terms of the GNU General Public License as published by
25 * the Free Software Foundation; either version 2 of the License, or 25 * the Free Software Foundation; either version 2 of the License, or
26 * (at your option) any later version. 26 * (at your option) any later version.
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
53static int write_bsd_utmp (int utmp_pos, struct utmp *wu); 53static int write_bsd_utmp (int utmp_pos, struct utmp *wu);
54static void update_wtmp (const char *fname, const struct utmp *putmp); 54static 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);

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines