[comp.sys.hp] rn on hp9000/3xx?

mike@delilah.lbl.gov (Michael Helm) (01/12/89)

I recently ported rn (a newsreader -- in its rrn form) to an HP-UX 6.2 
machine.  Everything seems to have gone well, but I have encountered a
minor, but puzzling, oddity & I wonder if anyone has any ideas about it 
&/| recommendations.

When an rn-user replies or follows up to an article, rn (in verbose
mode) displays the message/article header, a few informative messages,
then invokes a shell script which runs the editor &c, does a few
messages of its own, then returns to rn. Uh--or something like that.

Some of these messages seem to be getting truncated or omitted, mainly
those just before or after the shell script.  Not the mail message or
the article, understand, these seem ok, but the messages to the user
on the terminal.

I've found that by putting in little naps (sleep 1 & sleep(1) as approp)
here & there that things come out alrite.  It seems silly to have to
do something like this.  Does anyone have any idea why this is happening?

Thanks for your help,
Michael Helm  (Internet M_Helm@lbl.gov)

rdg@hpfcmr.HP.COM (Rob Gardner) (01/14/89)

> When an rn-user replies or follows up to an article, rn (in verbose

> Some of these messages seem to be getting truncated or omitted, mainly
> those just before or after the shell script.  Not the mail message or
> the article, understand, these seem ok, but the messages to the user
> on the terminal.
> 
> I've found that by putting in little naps (sleep 1 & sleep(1) as approp)
> here & there that things come out alrite.  It seems silly to have to
> do something like this.  Does anyone have any idea why this is happening?

A fair guess at your trouble:

It sounds to me like rn is flushing the tty output upon return from the
subshell. Does rn run in 'raw' mode? Does rn change any tty paramaters?
If it does, it might be using the TCSETA ioctl to do it, and this might
take effect before all the output has gotten out to the terminal. So,
it might be doing a TCFLSH, which might account for your truncated output.
Instead, rn should use TCSETAW, and drop the TCFLSH. TCSETAW will wait
for the output to drain before setting the new paramaters.


 
    Rob Gardner                     hplabs!hpfcmr!rdg
    Hewlett Packard                 or rdg%hpfcmr@hplabs.hp.com
    Fort Collins, Colorado          303-229-2048
		80525-9599

		     "Ask me about Home Brewing"