summaryrefslogtreecommitdiff
path: root/x11/wterm/patches
diff options
context:
space:
mode:
authortron <tron>2002-03-05 15:23:45 +0000
committertron <tron>2002-03-05 15:23:45 +0000
commit662b66b7acb496534f98d5599ca422a0f45f52c1 (patch)
tree35125423c2e3ef8e418bb66477f60e878c5d07ec /x11/wterm/patches
parent72978a3200d276d991238ce5f810c07f248c5700 (diff)
downloadpkgsrc-662b66b7acb496534f98d5599ca422a0f45f52c1.tar.gz
Fix build problems on NetBSD systems with utmp support including a work
arround for the lack of updwtmpx(3).
Diffstat (limited to 'x11/wterm/patches')
-rw-r--r--x11/wterm/patches/patch-aa43
-rw-r--r--x11/wterm/patches/patch-ab60
2 files changed, 103 insertions, 0 deletions
diff --git a/x11/wterm/patches/patch-aa b/x11/wterm/patches/patch-aa
new file mode 100644
index 00000000000..cd8825b04d9
--- /dev/null
+++ b/x11/wterm/patches/patch-aa
@@ -0,0 +1,43 @@
+$NetBSD: patch-aa,v 1.3 2002/03/05 15:23:46 tron Exp $
+
+--- src/wterm.h.orig Sun Mar 5 12:22:32 2000
++++ src/wterm.h Tue Mar 5 16:01:19 2002
+@@ -435,10 +435,14 @@
+ # ifdef _PATH_UTMP
+ # define UTMP_FILENAME _PATH_UTMP
+ # else
+-# ifdef WTERM_UTMP_FILE
+-# define UTMP_FILENAME WTERM_UTMP_FILE
++# ifdef _PATH_UTMPX
++# define UTMP_FILENAME _PATH_UTMPX
+ # else
+-# error define UTMP_FILENAME in config.h
++# ifdef WTERM_UTMP_FILE
++# define UTMP_FILENAME WTERM_UTMP_FILE
++# else
++# error define UTMP_FILENAME in config.h
++# endif
+ # endif
+ # endif
+ # endif
+@@ -458,6 +462,7 @@
+ # define getutid getutxid
+ # define endutent endutxent
+ # define pututline pututxline
++# define utmpname utmpxname
+ # else
+ # define UTMP struct utmp
+ # endif
+@@ -466,7 +471,11 @@
+ #ifdef WTMP_SUPPORT
+ # ifdef HAVE_UTMPX_H /* means we're on Solaris (or Irix?) */
+ # undef WTMP_FILENAME
+-# define WTMP_FILENAME WTMPX_FILE
++# ifdef __NetBSD__
++# define WTMP_FILENAME _PATH_WTMPX
++# else
++# define WTMP_FILENAME WTMPX_FILE
++# endif
+ # define update_wtmp updwtmpx
+ # else
+ # define update_wtmp wterm_update_wtmp
diff --git a/x11/wterm/patches/patch-ab b/x11/wterm/patches/patch-ab
new file mode 100644
index 00000000000..4a2b81ece15
--- /dev/null
+++ b/x11/wterm/patches/patch-ab
@@ -0,0 +1,60 @@
+$NetBSD: patch-ab,v 1.3 2002/03/05 15:23:46 tron Exp $
+
+--- src/utmp.c.orig Sun Mar 5 12:21:34 2000
++++ src/utmp.c Tue Mar 5 16:21:49 2002
+@@ -66,12 +66,18 @@
+ # endif
+ #endif
+
++#if defined(__NetBSD__) && defined(HAVE_UTMPX_H)
++#undef HAVE_UTMPX_H
++#define HAVE_UTMPX_H_KLUDGE
++#define wterm_update_wtmp updwtmpx
++#endif
++
+ /* ------------------------------------------------------------------------- */
+ #ifndef HAVE_UTMPX_H /* supposedly we have updwtmpx ? */
+ #ifdef WTMP_SUPPORT
+ /* PROTO */
+ void
+-wterm_update_wtmp(char *fname, struct utmp *putmp)
++wterm_update_wtmp(char *fname, UTMP *putmp)
+ {
+ int fd, retry = 10; /* 10 attempts at locking */
+ struct flock lck; /* fcntl locking scheme */
+@@ -90,7 +96,7 @@
+ close(fd);
+ return; /* failed for unknown reason: give up */
+ }
+- write(fd, putmp, sizeof(struct utmp));
++ write(fd, putmp, sizeof(UTMP));
+
+ /* unlocking the file */
+ lck.l_type = F_UNLCK;
+@@ -100,6 +106,12 @@
+ }
+ #endif /* WTMP_SUPPORT */
+ #endif /* !HAVE_UTMPX_H */
++
++#ifdef HAVE_UTMPX_H_KLUDGE
++#undef HAVE_UTMPX_H_KLUDGE
++#define HAVE_UTMPX_H
++#endif
++
+ /* ------------------------------------------------------------------------- */
+ #ifdef UTMP_SUPPORT
+ /*
+@@ -218,8 +230,13 @@
+ #endif /* HAVE_UTMP_HOST */
+
+ /* ut_name is normally the same as ut_user, but .... */
++#ifdef HAVE_UTMPX_H
++ STRNCPY(utmp.ut_user, (pwent && pwent->pw_name) ? pwent->pw_name : "?",
++ sizeof(utmp.ut_user));
++#else
+ STRNCPY(utmp.ut_name, (pwent && pwent->pw_name) ? pwent->pw_name : "?",
+ sizeof(utmp.ut_name));
++#endif
+
+ utmp.ut_pid = getpid();
+