fix for ved_postnews 
Author Message
 fix for ved_postnews

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;



Sun, 17 Dec 1995 17:38:59 GMT  
 
 [ 1 post ] 

 Relevant Pages 

1. Help Needed with ved_postnews (PS)

2. Help Needed with ved_postnews

3. VSE refactoring browser fix and fix needed

4. DEC FIXED, BIN FIXED...

5. Converting in-fix notation to Post-fix

6. fixed point vs fixed decimal

7. To FIX or not to FIX what is the POINT?

8. fixed vs floating hardware. was Re: Truncating fixed-point values

9. Is fix in Sun f90 1.2 really a fix?

10. A typo that is easy to fix, and can cause BIG problems if not fixed.

11. Squeak Bug Fixing Party at OOPSLA 2001

12. fix missing characters

 

 
Powered by phpBB® Forum Software