🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: news.software.readers
Article #9922

Re: Cron-able news saver? (related question)

#9922
From: Wayne Davison
Date: Fri, 08 Jul 1994 06:30
34 lines
1858 bytes
According to Steven King, Software Archaeologist <king@wildebeest.cig.mot.com>:
> I also apologize that the script didn't run the way I thought it would.
> Even after this fix, Peter is exactly right.  It runs from the command
> line, but doesn't run when invoked from cron.  I get "13499 Abort - core
> dumped" when I try.

I think that this is because some Configurations of trn (not all) attempt
to open /dev/tty to turn on the no-delay input.  Try this patch (untested):

Index:term.c
@@ -149,10 +149,13 @@
     /* do no delay reads on something that always gets closed on exit */
 
-    devtty = open("/dev/tty",0);
-    if (devtty < 0) {
-	printf(cantopen,"/dev/tty") FLUSH;
-	finalize(1);
+    devtty = fileno(stdin);
+    if (isatty(devtty)) {
+	devtty = open("/dev/tty",0);
+	if (devtty < 0) {
+	    printf(cantopen,"/dev/tty") FLUSH;
+	    finalize(1);
+	}
+	fcntl(devtty,F_SETFL,O_NDELAY);
     }
-    fcntl(devtty,F_SETFL,O_NDELAY);
 #endif
 #endif

and let me know if it works.  Thanks!
-- 
Wayne Davison
davison@borland.com
Technical Details
Message-ID: <CsLzEE.2Gw@borland.com>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!archive!mbox2nntp-news.software.readers.mbox.zip!bga.com!news.sprintlink.net!news.onramp.net!convex!cs.utexas.edu!swrinde!elroy.jpl.nasa.gov!decwrl!borland.com!davison
References: <CsFw0r.MLo@undergrad.math.uwaterloo.ca> <1994Jul6.195017.26518@kocrsv01.delcoelect.com> <CsJu1u.Ex4@undergrad.math.uwaterloo.ca> <2vh39b$res@delphinium.cig.mot.com>

Show Full Headers
Complete Article Headers
Message-ID: <CsLzEE.2Gw@borland.com>
Subject: Re: Cron-able news saver? (related question)
Date: Fri, 8 Jul 1994 06:30:14 GMT
From: davison@borland.com (Wayne Davison)
References: <CsFw0r.MLo@undergrad.math.uwaterloo.ca> <1994Jul6.195017.26518@kocrsv01.delcoelect.com> <CsJu1u.Ex4@undergrad.math.uwaterloo.ca> <2vh39b$res@delphinium.cig.mot.com>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!archive!mbox2nntp-news.software.readers.mbox.zip!bga.com!news.sprintlink.net!news.onramp.net!convex!cs.utexas.edu!swrinde!elroy.jpl.nasa.gov!decwrl!borland.com!davison
Newsgroups: news.software.readers
Organization: Borland International
Lines: 34