lynx-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: lynx-dev 2.8.1 fails under cron (with ncurses & nsl-fork)


From: dickey
Subject: Re: lynx-dev 2.8.1 fails under cron (with ncurses & nsl-fork)
Date: Tue, 1 Dec 1998 21:54:44 -0500 (EST)

> A few days ago, at my suggestion, one of our sysadmins upgraded lynx 
> from v2.8-rel.2 to v2.8.1-rel.1, on our FreeBSD 2.2.7-STABLE platforms. 
>  
> Immediately, some users who were running "lynx -dump" via cron, started 
> getting failures, using such simple cron'd shell scripts as: 
>  
>  #!/bin/sh 
>  
>  /usr/local/bin/lynx -dump http://www.sun.com/ >$HOME/tmp/lynx.out 

ok - it is not an ncurses bug, but a small error in Bela's nsl-fork logic that
happens to be ifdef'd to exclude slang (he neglected to check that
stdin is a tty in that chunk).  I've a fix, am about 1/3 through integrating
other patches.  fyi:

> diff -u HTTCP.c.orig HTTCP.c
--- HTTCP.c.orig        Wed Nov 18 14:45:34 1998
+++ HTTCP.c     Tue Dec  1 21:41:30 1998
@@ -539,7 +539,7 @@
                **  selectable!  /dev/null isn't, on some systems, which
                **  makes some useful Lynx invocations fail.  -BL
                */
-               if (ok_to_select_stdin == -1) {
+               if ((ok_to_select_stdin == -1) && isatty(fileno(stdin))) {
                    timeout.tv_sec = 0;
                    timeout.tv_usec = 0;
                    FD_SET(0, &readfds);    /* stdin -BL */
@@ -548,7 +548,7 @@
                    else ok_to_select_stdin = 0;
                    FD_ZERO(&readfds);
                }
-               if (ok_to_select_stdin) FD_SET(0, &readfds);
+               if (ok_to_select_stdin == 1) FD_SET(0, &readfds);
 #endif /* USE_SLANG */
                timeout.tv_sec = 1;
                timeout.tv_usec = 0;



-- 
Thomas E. Dickey
address@hidden
http://www.clark.net/pub/dickey

reply via email to

[Prev in Thread] Current Thread [Next in Thread]