aboutsummaryrefslogtreecommitdiffstats
path: root/x11
diff options
context:
space:
mode:
authorrea <rea@FreeBSD.org>2016-07-24 11:42:25 +0800
committerrea <rea@FreeBSD.org>2016-07-24 11:42:25 +0800
commit4e0aec0f78729b6ad4f43691c3ca4bdaf92b0bd1 (patch)
tree7b58d25829657b65bc6370967a88979798f61758 /x11
parent9692a153aa308b08ee99a99af6deaa5518632500 (diff)
downloadfreebsd-ports-gnome-4e0aec0f78729b6ad4f43691c3ca4bdaf92b0bd1.tar.gz
freebsd-ports-gnome-4e0aec0f78729b6ad4f43691c3ca4bdaf92b0bd1.tar.zst
freebsd-ports-gnome-4e0aec0f78729b6ad4f43691c3ca4bdaf92b0bd1.zip
x11/xrvt-unicode: chase removal of ttyslot() in base
This function (that returns ID of the tty slot) was removed shortly after utmpx was brought to the base system. Avoid using it in newer FreeBSD versions. ACKed by: thierry@
Diffstat (limited to 'x11')
-rw-r--r--x11/rxvt-unicode/files/patch-chase-ttyslot-removal32
1 files changed, 32 insertions, 0 deletions
diff --git a/x11/rxvt-unicode/files/patch-chase-ttyslot-removal b/x11/rxvt-unicode/files/patch-chase-ttyslot-removal
new file mode 100644
index 000000000000..9e44bc989051
--- /dev/null
+++ b/x11/rxvt-unicode/files/patch-chase-ttyslot-removal
@@ -0,0 +1,32 @@
+--- libptytty/src/ptytty.C.orig 2016-07-22 21:10:56.246647000 +0300
++++ libptytty/src/ptytty.C 2016-07-22 21:33:18.005377000 +0300
+@@ -56,6 +56,11 @@
+ # define O_NOCTTY 0
+ #endif
+
++/* We need __FreeBSD_version */
++#if defined(__FreeBSD__)
++#include <sys/param.h>
++#endif
++
+ /////////////////////////////////////////////////////////////////////////////
+
+ /* ------------------------------------------------------------------------- *
+@@ -395,7 +400,17 @@
+ int fd_stdin = dup (STDIN_FILENO);
+ dup2 (tty, STDIN_FILENO);
+
++/*
++ * FreeBSD base@r202219 phased out utmp and moved to utmpx.
++ * ttyslot() was eliminated slightly after this, in r202274,
++ * but __FreeBSD_version wasn't bumped then. Such discrepance
++ * should be harmless since we will lose at most an utmp record.
++ */
++#if defined(__FreeBSD_version) && __FreeBSD_version >= 900007
++ utmp_pos = -1;
++#else
+ utmp_pos = ttyslot ();
++#endif
+
+ dup2 (fd_stdin, STDIN_FILENO);
+ close (fd_stdin);