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.38 by root, Sun Jan 22 04:01:52 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 * 22 *
22 * 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
23 * 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
24 * the Free Software Foundation; either version 2 of the License, or 25 * the Free Software Foundation; either version 2 of the License, or
25 * (at your option) any later version. 26 * (at your option) any later version.
34 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 35 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
35 *----------------------------------------------------------------------*/ 36 *----------------------------------------------------------------------*/
36 37
37#include "../config.h" 38#include "../config.h"
38 39
40#include "ptytty.h"
41
42#if UTMP_SUPPORT
43
39#include <cstdio> 44#include <cstdio>
40 45
41#include <sys/types.h> 46#include <sys/types.h>
42#include <sys/stat.h> 47#include <sys/stat.h>
43#include <sys/fcntl.h> 48#include <sys/fcntl.h>
44#include <unistd.h> 49#include <unistd.h>
45#include <time.h> 50#include <time.h>
46
47#include "ptytty.h"
48
49#if UTMP_SUPPORT
50 51
51#if HAVE_STRUCT_UTMP 52#if HAVE_STRUCT_UTMP
52static int write_bsd_utmp (int utmp_pos, struct utmp *wu); 53static int write_bsd_utmp (int utmp_pos, struct utmp *wu);
53static void update_wtmp (const char *fname, const struct utmp *putmp); 54static void update_wtmp (const char *fname, const struct utmp *putmp);
54#endif 55#endif
425 426
426# ifdef HAVE_STRUCT_LASTLOG 427# ifdef HAVE_STRUCT_LASTLOG
427 pwent = getpwuid (getuid ()); 428 pwent = getpwuid (getuid ());
428 if (!pwent) 429 if (!pwent)
429 { 430 {
430 ptytty_warn ("no entry in password file, not updating lastlog.\n"); 431 ptytty_warn ("no entry in password file, not updating lastlog.\n", 0);
431 return; 432 return;
432 } 433 }
433 434
434 memset (&ll, 0, sizeof (ll)); 435 memset (&ll, 0, sizeof (ll));
435 ll.ll_time = time (NULL); 436 ll.ll_time = time (NULL);

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines