[comp.unix.xenix] rn patches for SCO Xenix 386 2.3

ronald@robobar.co.uk (Ronald S H Khoo) (04/07/90)

In article <4080@uceng.UC.EDU> rsexton@uceng.UC.EDU (robert sexton) writes:
>Greetings.  I am having a little trouble compiling rn under 386 2.3.2

Indeed!  And just as I'd prepared a patch kit for my own archives.
Here it is:

[This is an open letter to Stan Barber containing patches to rn 4.3 PL44
 for use with SCO Xenix 386.  If your rn works fine, hit 'n' NOW !]

Dear Stan,
	First of all I'd like to thank you for having looked after rn 4.3
up until PL44.  I'd like to know whether or not you are continuing to
add modsets to 4.3.  The reason I ask is that I've just been tidying up
my machine and only just upgraded properly to PL44, retrofitting a few
hacks I've needed to keep rn working reliably under SCO Xenix and was
wondering if you would like to add SCO Xenix instructions the collection.

How long do you think that rn will continue to be either a "in current use"
or "live, with ongoing support" product ?

If you've given up with rn, please don't bother to read any further!

For the record, I'm on SCO Xenix 2.3.2.  I have cursorily tested this patch
kit with the 2.3 development system, though the copy I've been using has been
compiled with gcc.

The changes I've had to make are as follows:

1) Configure thinks that Xenix is "usg" and expects to find "pdp11" which
   isn't present.  Fix: echo exit 1 > pdp11; chmod +x pdp11
   before running Configure.

2) Xenix doesn't have FIONREAD, but does have rdchk() which is sufficient.
   The non-FIONREAD code in rn seems to be intermittent under Xenix, with
   occasional "can't open /dev/tty: no such device or address" problems
   that I never could track down.  Anyway, patches to term.h and term.c
   to use rdchk instead depending on -DHAVE_RDCHK below.  I didn't make the
   accompanying changes to Configure, too painful.  The linker library -lx
   is required.  I just hacked them into Makefile by hand.  Sorry.
   term.c doesn't appear to compile properly under Xenix without this patch
   anyway, and I can't remember what the alternative is.
   This modset should also be applicable to System V 3.2.

3) The sed command in newsgroups.SH doesn't work with certain (USG
   derived ?) seds, with -e /pat/p -e d producing no output.  Leaving
   out the -e d and using -n fixes this, but I don't know if this fix
   needs to be conditional on seds that don't do -n ?  Are there any?
   Anyway, the patch to newsgroups.SH I use is below.

4) The recently advertised change of ACT_POS from short to long just
   became necessary here with the onset of bit.* :-(  In case you missed
   it, it appears as a patch to common.h below.

5) I had to comment out the (incorrect for Xenix) declarations for
   fseek() and sprintf() in common.h  and the declaration
   for signal() at line 51 in util.c for this to work.

I don't know what to do with this info, so I've mailed it to you and
posted it here.  Patches are relative to rn 4.3 PL44.  Have a nice day.

*** ../rn44/term.c	Fri Apr  6 19:49:39 1990
--- ./term.c	Fri Apr  6 19:38:46 1990
***************
*** 138,144 ****
  #endif
  
  #ifdef PENDING
! #ifndef FIONREAD
      /* do no delay reads on something that always gets closed on exit */
  
      devtty = open("/dev/tty",0);
--- 138,144 ----
  #endif
  
  #ifdef PENDING
! #if ! defined (FIONREAD) && ! defined (HAVE_RDCHK)
      /* do no delay reads on something that always gets closed on exit */
  
      devtty = open("/dev/tty",0);
***************
*** 593,599 ****
  }
  
  #ifdef PENDING
! #ifndef FIONREAD
  int
  circfill()
  {
--- 593,599 ----
  }
  
  #ifdef PENDING
! #if ! defined (FIONREAD) && ! defined (HAVE_RDCHK)
  int
  circfill()
  {


*** ../rn44/term.h	Fri Apr  6 19:49:51 1990
--- ./term.h	Fri Apr  6 19:39:39 1990
***************
*** 28,33 ****
--- 28,36 ----
  #define input_pending() bizarre
  #endif lint
  #else FIONREAD
+ #ifdef HAVE_RDCHK
+ #define input_pending() (rdchk(0) > 0)		/* boolean only */
+ #else /*  HAVE_RDCHK */
  int circfill();
  EXT int devtty INIT(0);
  #ifndef lint
***************
*** 35,40 ****
--- 38,44 ----
  #else
  #define input_pending() bizarre
  #endif lint
+ #endif /* HAVE_RDCHK */
  #endif FIONREAD
  #else PENDING
  #ifndef lint
***************
*** 56,61 ****
--- 60,69 ----
  
  #else FIONREAD
  
+ #ifdef HAVE_RDCHK
+ #define input_pending() (rdchk(0) > 0)		/* boolean only */
+ #else /*  HAVE_RDCHK */
+ 
  EXT int devtty INIT(0);
  EXT bool is_input INIT(FALSE);
  EXT char pending_ch INIT(0);
***************
*** 64,69 ****
--- 72,78 ----
  #else
  #define input_pending() bizarre
  #endif lint
+ #endif /*  HAVE_RDCHK */
  #endif FIONREAD
  #else PENDING
  #define read_tty(addr,size) read(0,addr,size)


This is the thing which might need some help from Configure to decide
which version to use.

*** ../rn44/newsgroups.SH	Fri Apr  6 19:49:41 1990
--- ./newsgroups.SH	Fri Apr  6 17:41:24 1990
***************
*** 57,69 ****
  : bogus newsgroups from showing up as unsubscribed.
  
  $cat \$dotdir/.newsrc \$dotdir/.newsrc \$active | \\
! $sed	-e '/^options/d' \\
  	-e '/^[	 ]/d' \\
  	-e '/^control/d' \\
  	-e '/^to\./d' \\
  	-e 's/^\([^ !:]*\)[ !:].*\$/\1/' \\
! 	-e "/.*\$1/p" \\
! 	-e 'd' | \\
  $sort | $uniq -u | \$pager
  if $test \$# -ge 2 ; then
      exit
--- 57,68 ----
  : bogus newsgroups from showing up as unsubscribed.
  
  $cat \$dotdir/.newsrc \$dotdir/.newsrc \$active | \\
! $sed -n	-e '/^options/d' \\
  	-e '/^[	 ]/d' \\
  	-e '/^control/d' \\
  	-e '/^to\./d' \\
  	-e 's/^\([^ !:]*\)[ !:].*\$/\1/' \\
! 	-e "/.*\$1/p" | \\
  $sort | $uniq -u | \$pager
  if $test \$# -ge 2 ; then
      exit
***************
*** 72,80 ****
  read tmp
  $echo ""
  $echo "Unsubscribed but mentioned in .newsrc:"
! $sed < \$dotdir/.newsrc \\
! 	-e "/\$1.*!/"'s/^\([^!]*\)!.*\$/\1/p' \\
! 	-e 'd' | \\
  $sort | \$pager
  !GROK!THIS!
  case "$isrrn" in
--- 71,78 ----
  read tmp
  $echo ""
  $echo "Unsubscribed but mentioned in .newsrc:"
! $sed -n < \$dotdir/.newsrc \\
! 	-e "/\$1.*!/"'s/^\([^!]*\)!.*\$/\1/p' | \\
  $sort | \$pager
  !GROK!THIS!
  case "$isrrn" in


This is the patch which was recently advertised in news.software.b

*** ../rn44/common.h	Fri Apr  6 19:49:56 1990
--- ./common.h	Wed Apr  4 11:40:06 1990
***************
*** 716,722 ****
  #endif
  typedef long		ART_POS;	/* char position in article file */
  typedef int		ART_LINE;	/* line position in article file */
! typedef short		ACT_POS;	/* char position in active file */
  typedef unsigned int	MEM_SIZE;	/* for passing to malloc */
  
  
--- 716,722 ----
  #endif
  typedef long		ART_POS;	/* char position in article file */
  typedef int		ART_LINE;	/* line position in article file */
! typedef long		ACT_POS;	/* char position in active file */
  typedef unsigned int	MEM_SIZE;	/* for passing to malloc */
  
  


-- 
Eunet: Ronald.Khoo@robobar.Co.Uk   Phone: +44 1 991 1142    Fax: +44 1 998 8343
Paper: Robobar Ltd. 22 Wadsworth Road, Perivale, Middx., UB6 7JD ENGLAND.