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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
|
$NetBSD: patch-ai,v 1.1 2004/09/15 18:29:20 minskim Exp $
--- src/logging.c.orig Sun Dec 15 18:33:04 2002
+++ src/logging.c
@@ -137,7 +137,9 @@ rxvt_makeutent(rxvt_t *r, const char *pt
STRNCPY(utx->ut_user, (pwent && pwent->pw_name) ? pwent->pw_name : "?",
sizeof(utx->ut_user));
STRNCPY(utx->ut_id, ut_id, sizeof(utx->ut_id));
+# ifdef HAVE_UTMPX_SESSION
utx->ut_session = getsid(0);
+# endif
utx->ut_tv.tv_sec = time(NULL);
utx->ut_tv.tv_usec = 0;
utx->ut_pid = r->h->cmd_pid;
@@ -203,7 +205,11 @@ rxvt_makeutent(rxvt_t *r, const char *pt
# endif
# endif
# ifdef HAVE_STRUCT_UTMPX
+# ifdef HAVE_UPDWTMPX
updwtmpx(RXVT_WTMPX_FILE, utx);
+# else
+ pututxline(utx);
+# endif
# endif
}
#endif
@@ -254,7 +260,9 @@ rxvt_cleanutent(rxvt_t *r)
if ((tmputx = getutxid(utx))) /* position to entry in utmp file */
utx = tmputx;
utx->ut_type = DEAD_PROCESS;
+# ifdef HAVE_UTMPX_SESSION
utx->ut_session = getsid(0);
+# endif
utx->ut_tv.tv_sec = time(NULL);
utx->ut_tv.tv_usec = 0;
#endif
@@ -275,7 +283,11 @@ rxvt_cleanutent(rxvt_t *r)
# endif
# endif
# ifdef HAVE_STRUCT_UTMPX
+# ifdef HAVE_UPDWTMPX
updwtmpx(RXVT_WTMPX_FILE, utx);
+# else
+ pututxline(utx);
+# endif
# endif
}
#endif
@@ -327,7 +339,7 @@ rxvt_write_bsd_utmp(int utmp_pos, struct
/*
* Update a BSD style wtmp entry
*/
-#if defined(WTMP_SUPPORT) && !defined(HAVE_UPDWTMP)
+#if defined(WTMP_SUPPORT) && !defined(HAVE_UPDWTMP) && defined(HAVE_STRUCT_UTMP)
/* INTPROTO */
void
rxvt_update_wtmp(const char *fname, const struct utmp *putmp)
|