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
58
59
60
61
62
63
64
65
66
67
68
69
70
|
diff -ru inetutils-1.5/configure.ac inetutils-1.5+iPhone/configure.ac
--- inetutils-1.5/configure.ac 2007-06-28 22:58:23.000000000 +0000
+++ inetutils-1.5+iPhone/configure.ac 2008-01-02 02:07:05.000000000 +0000
@@ -776,8 +776,7 @@
AC_DEFINE(UTMPX, 1, [FIXME])
AC_DEFINE(HAVE_STREAMSPTY, 1, [FIXME])
;;
-*irix* | *hpux*)
- AC_DEFINE(UTMPX, 1, [FIXME])
+*irix* | *hpux* | *darwin*)
AC_DEFINE(UTMPX, 1, [FIXME])
;;
esac
diff -ru inetutils-1.6/libinetutils/utmp_logout.c inetutils-1.6+iPhone/libinetutils/utmp_logout.c
--- inetutils-1.6/libinetutils/utmp_logout.c 2006-10-21 15:24:20.000000000 +0000
+++ inetutils-1.6+iPhone/libinetutils/utmp_logout.c 2009-04-09 10:07:11.000000000 +0000
@@ -52,12 +52,22 @@
if ((ut = getutxline (&utx)))
{
+# ifdef HAVE_STRUCT_UTMPX_UT_TYPE
ut->ut_type = DEAD_PROCESS;
+# endif
+# ifdef HAVE_STRUCT_UTMPX_UT_EXIT
ut->ut_exit.e_termination = 0;
ut->ut_exit.e_exit = 0;
+# endif
+# ifdef HAVE_STRUCT_UTMPX_UT_TV
gettimeofday (&(ut->ut_tv), 0);
+# else
+ time (&(ut->ut_time));
+# endif
pututxline (ut);
+# ifdef HAVE_UPDWTMPX
updwtmpx (PATH_WTMPX, ut);
+# endif
}
endutxent ();
#else
diff -ru inetutils-1.6/libinetutils/logwtmp.c inetutils-1.6+iPhone/libinetutils/logwtmp.c
--- inetutils-1.6/libinetutils/logwtmp.c 2007-06-29 16:29:31.000000000 +0000
+++ inetutils-1.6+iPhone/libinetutils/logwtmp.c 2009-04-10 19:44:24.000000000 +0000
@@ -48,6 +48,7 @@
# include <utmp.h>
#else
# ifdef HAVE_UTMPX_H
+# define _UTMPX_COMPAT
# include <utmpx.h>
# define utmp utmpx /* make utmpx look more like utmp */
# endif
@@ -113,16 +114,16 @@
/* Set information in new entry. */
bzero (&ut, sizeof (ut));
-#ifdef HAVE_STRUCT_UTMP_UT_TYPE
+#if defined(HAVE_STRUCT_UTMP_UT_TYPE) || defined(HAVE_STRUCT_UTMPX_UT_TYPE)
ut.ut_type = USER_PROCESS;
#endif
strncpy (ut.ut_line, line, sizeof ut.ut_line);
strncpy (ut.ut_name, name, sizeof ut.ut_name);
-#ifdef HAVE_STRUCT_UTMP_UT_HOST
+#if defined(HAVE_STRUCT_UTMP_UT_HOST) || defined(HAVE_STRUCT_UTMPX_UT_HOST)
strncpy (ut.ut_host, host, sizeof ut.ut_host);
#endif
-#ifdef HAVE_STRUCT_UTMP_UT_TV
+#if defined(HAVE_STRUCT_UTMP_UT_TV) || defined(HAVE_STRUCT_UTMPX_UT_TV)
gettimeofday (&ut.ut_tv, NULL);
#else
time (&ut.ut_time);
|