Subject: Fix for X11R6-pl3 xterm +ut and XTerm*utmpInhibit for FreeBSD & NetBSD
To: None <xbugs@x.org, xfree86-beta@XFree86.Org, freebsd-hackers@freefall.cdrom.com,>
From: Julian H Stacey <Julian.H.Stacey@regent.e-technik.tu-muenchen.de>
List: current-users
Date: 08/23/1994 10:49:28
Patch For: 	X11R6-pl3/xc/programs/xterm 
Why:		To get `+ut' and `XTerm*utmpInhibit' to work,
		Without it xterm tries to create an entry in /etc/utmp.
Tested with:	FreeBSD 1.1.5-Current.
Also for:	NetBSD-current 94 08 12 sources,
Background:	Before fixing this FreeBSD `talk` couldn't find a utmp entry
		for my xterms, so users couldn't initiate `talk` to me.
#if BSD_NET2:	Can't be used instead of (__FreeBSD__ || __NetBSD__) as:
		cpp -dM < /dev/null defines for FreeBSD:
			__FreeBSD__ __386BSD__ ____386BSD____ i386
			BSD_NET2 __GNUC__ unix
		cpp -dM < /dev/null defines for NetBSD:
			ns32k __NetBSD__ ns32532 pc532 __GNUC__ unix
		Don't know if FreeBSD-2 will define BSD_NET2 or need this patch.
		I left #if BSD_NET2 in, in case it helps BSD/386.
xfree86-beta@xfree86.org:
		My apologies, I don't know if this is necessary for latest test
		version of XFree86, I've temporarily lost my site details for 
		src ftp-mail & ftp, so haven't read that source yet.
Copyright:	I grant this to the public domain, I disclaim liability :-)
Replies:	You may want to prune `To:' & `Cc:' lines which include:
			xbugs@x.org	xfree86-beta@xfree86.org
			freebsd-hackers@freefall.cdrom.com
			current-users@sun-lamp.cs.berkeley.edu
--
Julian Stacey, Holz Str 27d, Munich, D-80469 Germany.
<stacey@freefall.cdrom.com>	Tel. +49 89 268616  ( TZ=GMT+1 )
Alternates:	<julian@pcsbst.pcs.com>,<jhs@regent.e-technik.tu-muenchen.de>

Cut {=========
*** old/X11R6.pl3.xc/programs/xterm/main.c	Mon Aug 22 10:52:35 1994
--- new/X11R6.pl3.xc/programs/xterm/main.c	Mon Aug 22 13:39:57 1994
***************
*** 263,268 ****
--- 263,273 ----
  #define USE_GET_PSEUDOTTY
  #endif
  
+ #if BSD_NET2 || __FreeBSD__ || __NetBSD__ 
+ /* For FreeBSD 1.1.5(RELEASE) & NetBSD-current@94.08.12: /var/run/utmp */
+ #define	UTMP_FILENAME	_PATH_UTMP
+ #endif
+ 
  #ifndef UTMP_FILENAME
  #ifdef UTMP_FILE
  #define UTMP_FILENAME UTMP_FILE
Cut ========}

------------------------------------------------------------------------------