summaryrefslogtreecommitdiff
path: root/chat/climm/patches/patch-aa
diff options
context:
space:
mode:
Diffstat (limited to 'chat/climm/patches/patch-aa')
-rw-r--r--chat/climm/patches/patch-aa47
1 files changed, 47 insertions, 0 deletions
diff --git a/chat/climm/patches/patch-aa b/chat/climm/patches/patch-aa
new file mode 100644
index 00000000000..77c44ca9b92
--- /dev/null
+++ b/chat/climm/patches/patch-aa
@@ -0,0 +1,47 @@
+$NetBSD: patch-aa,v 1.1.1.1 2007/11/28 11:45:34 mjl Exp $
+
+--- src/os_unix.c.orig 2007-11-28 11:58:20.000000000 +0100
++++ src/os_unix.c 2007-11-28 12:13:49.000000000 +0100
+@@ -17,6 +17,12 @@
+ #include <ctype.h>
+ #endif
+
++#ifndef MAXINT
++#include <limits.h>
++#include <utmpx.h>
++#define MAXINT INT_MAX
++#endif
++
+ static int console_idle (time_t now, struct utmp *u)
+ {
+ struct stat sbuf;
+@@ -43,7 +49,7 @@
+ */
+ UDWORD os_DetermineIdleTime (time_t now, time_t last)
+ {
+- struct utmp *u;
++ struct utmpx *u;
+ struct passwd *pass;
+ uid_t uid;
+ int tmp, min = MAXINT;
+@@ -54,9 +60,8 @@
+ if (!pass)
+ return -1;
+
+- utmpname (UTMP_FILE);
+- setutent();
+- while ((u = getutent()))
++ setutxent();
++ while ((u = getutxent()))
+ {
+ if (u->ut_type != USER_PROCESS)
+ continue;
+@@ -67,7 +72,7 @@
+ tmp = console_idle (now, u);
+ min = (tmp < min) ? tmp : min ;
+ }
+- endutent();
++ endutxent();
+ if (min == MAXINT || now - last < min)
+ min = now - last;
+ return min;