[Date Prev] [Date Next] [Thread Prev] [Thread Next] Date Index Thread Index Search archive:
Date:Mon Jun 30 09:38:59 1993 
Subject:fix for ved_postnews 
From:"A.Sloman" 
Volume-ID:930630.03 

The current version of ved_postnews forks, spawns a process to run
inews, and pipes the news article through it. This causes a system error
if various X utilities have been used, for some unknown reason.
(In Poplog V14.2)

I have found that by redefining the procedure sendnews to write to a
temporary file and then call inews with that file as argument, using
sysobey, I can make the system error go away. Below is my version of
sendnews.
(Reminder - the header for LIB ED_POSTNEWS says that it is not
supported.)
Aaron
-----------------------------------------------------------------------
Fix for sendnews follows. Use it to replace version in
$usepop/pop/lib/ved/ved_postnews.p

or your local variant.

I haven't checked that the cancel option still works, as I hardly ever
use it and I am too busy now!

NB look for warning labelled NB if you use remote inews site
----------------------------------------------------------------------

define lconstant sendnews(cancelling);
	;;; If cancelling is false send the marked range as a news file
	;;;	If true then send cancelling message for current news message
	lvars
		din, dout, line, num = 1, limit, child, dev, cancelling,
		inews_args,
		inews_prog = false,
		inews_endarg = if cancelling then cancelargs() else '-h' endif
		;

	dlocal popexit, inews_remote_host;

	max(num,vvedbuffersize) -> limit;
	until vedusedsize(vedbuffer(num)) /== 0 do
		num fi_+ 1 -> num;
		if num fi_> limit then vederror('NO MESSAGE') endif
	enduntil;

	;;; set up pointer to remote machine running inews, if necessary
	if vedargument /= nullstring then
		vedargument -> inews_remote_host;
		false
	else
		inews_prog_file
	endif -> inews_prog;

	if inews_prog and (readable(inews_prog) ->> dev) then
		;;; inews available on this machine
		sysclose(dev);
		if cancelling then
			;;; send cancel message on this machine and return
			sysobey(
				inews_prog_file sys_>< space sys_>< inews_endarg
					sys_>< ' < /dev/null', `$`
					);
			return();
		else
			[^inews_arg ^inews_endarg]-> inews_args;
		endif
	else
		;;; Do it remotely
		[^rsh_command_name ^inews_remote_host
				^(inews_prog_file sys_>< space sys_>< inews_endarg)] -> inews_args;
		rsh_command -> inews_prog;
	endif;

	lvars tempfile = systmpfile('/tmp', popusername, '.post');
	veddo('w ' <> tempfile);

	;;; WARNING
	;;; The next line may need to be changed at some sites, e.g. to use
	;;; cat and rsh and a remote call of inews
	sysobey('inews ' <> tempfile);

	;;; Previous stuff to fork and exec deleted

enddefine;