summaryrefslogtreecommitdiff
path: root/x11/rxvt/patches/patch-af
blob: ebb874125ac59db3521581462f954013be63d38e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
$NetBSD: patch-af,v 1.5 2002/10/26 18:02:17 bouyer Exp $

--- src/logging.c.orig	Mon Sep 30 22:44:27 2002
+++ src/logging.c	Mon Sep 30 23:00:46 2002
@@ -130,6 +130,17 @@
 void
 rxvt_update_lastlog(const char *fname, const char *pty, const char *host)
 {
+# if defined(RXVT_UTMP_AS_UTMPX) && !defined(SunOS)
+    struct lastlogx ll;
+    char filename[FILENAME_MAX];
+
+    MEMSET(&ll, 0, sizeof(ll));
+    gettimeofday(&ll.ll_tv, NULL);
+    STRNCPY(ll.ll_line, pty, sizeof(ll.ll_line));
+    STRNCPY(ll.ll_host, host, sizeof(ll.ll_host));
+
+    updlastlogx(RXVT_UTMPX_FILE, geteuid(), &ll);
+# else
 # ifdef HAVE_STRUCT_LASTLOG
     int             fd;
     struct passwd  *pwent;
@@ -165,6 +176,7 @@
     }
 #  endif			/* LASTLOG_IS_DIR */
 # endif				/* HAVE_STRUCT_LASTLOG */
+# endif				/* RXVT_UTMP_AS_UTMPX */
 }
 #endif				/* LASTLOG_SUPPORT */
 /* ------------------------------------------------------------------------- */