Not directly related, but when tinkering with poll_for_status in lprng's
lpd_jobs.c, I believe that statb in Printer_open() can be used before
initialization if the lp device is not a pathname (line 2510, et seq.).
The following is one fix:
*** lpd_jobs.orig Thu Apr 11 16:03:22 2002
--- lpd_jobs.c Thu Apr 11 15:11:09 2002
***************
*** 2405,2410 ****
--- 2405,2413 ----
*filterpid = pid;
*status_fd = device_fd = in[1];
+ if( fstat( device_fd, &statb ) < 0 ) {
+ LOGERR_DIE(LOG_INFO)"Printer_open: fstat() on
+device_fd failed");
+ }
if( (close( in[0] ) == -1 ) ){
LOGERR_DIE(LOG_INFO)"Printer_open: close(%d) failed",
in[0]);
}
***************
*** 2460,2465 ****
--- 2463,2471 ----
}
DEBUG1( "Printer_open: doing link open '%s'", lp_device );
*status_fd = device_fd = Link_open( host, port, connect_tmout,
0, 0 );
+ if( fstat( device_fd, &statb ) < 0 ) {
+ LOGERR_DIE(LOG_INFO)"Printer_open: fstat() on
+device_fd failed");
+ }
err = errno;
break;
}
Or just wiping statb with 0's earlier on is probably fine as well.
_Rob
At 3:54pm, Rob Joyce wrote:
> Thanks. The latest version I see on ftp.lprng.com is 3.5.8alpha2, dated
> April 3.
>
> One thing I noticed is that ps_eoj@ and ps_eoj_at_end@ didn't have any
> effect until I added the following to vars.c:
>
> { "Ps_eoj", "ps_eoj", (char **)&Ps_eoj, FLGV,0 },
> { "Ps_eoj_at_end", "ps_eoj_at_end", (char **)&Ps_eoj_at_end, FLGV,0 },
>
> Even completely quashing the ^D's doesn't quite solve the problem, as the
> printer will wait for data as long as the connection's open. From what I
> gather, ^T and ^D are technically invalid over non-serial-line PostScript
> channels. Looking at netatalk's pap.c source, it appears that status
> requests (^T) and EOJ (^D) are sent out-of-band, so it would be
> impossible(*) for ifhp to send these over a pipe to lp=|/path/to/pap.
>
> As pap gathers status information anyway, one can pretty easily modify
> pap.c to put this on stdout or stderr. My question now is, how does one
> format/route this information so it's visible in lpq? (It would be
> helpful, e.g., to see "paper out" status messages in lpq.) I tried
> forcing both ifhp's and lprng's poll_for_status on, but that didn't work.
> I did -- once -- see a PostScript status message in the Status: (not
> Filter_status:) line of lpq, but I've been unable to repeat it.
>
> Thanks,
> _Rob
>
> (*) I guess the Adobe TBCP standard would help, but I'm a little hesitant
> to try that.
>
>
> On April 10th, Patrick Powell wrote:
>
> > > Date: Mon, 8 Apr 2002 20:57:47 -0400
> > > From: Rob Joyce <[EMAIL PROTECTED]>
> > > To: [EMAIL PROTECTED]
> > > Subject: LPRng: Netatalk, LaserWriter, and ^D
> > >
> > > Hi all,
> > >
> > > We have LPRng 3.8.10 and ifhp 3.5.7 running on Solaris 7, and can print
> > > just fine to HP/Jetdirect printers and others. But for some reason
> > > printing via AppleTalk fails to both Apple and HP printers (that normally
> > > can do AppleTalk); they seem to issue PostScript errors about ^D.
> > > netatalk is 1.4b2+asun2.1.4 from May 2000, and
> > > "cat test.ps | /usr/local/bin/pap -e -p 'printer name'" works fine.
> > >
> > > lpd_printcap contains:
> > >
> > > iss
> > > :tc=.cf_server
> > > :cm=B327, LaserWriter Pro 630, ISS Group
> > > :lp=| -$ /usr/local/bin/pap -e -p "iss - B317, LaserWriter Pro 630"
> > > :ifhp=model=apple,debug=1
> > >
> > > .cf_server
> > > :server
> > > :filter=/usr/local/libexec/filters/ifhp
> > > :sd=/var/spool/lpd/%P
> > > :mx=0
> > > :mc=0
> > >
> > > Adding ",ps_eoj@,ps_eoj_at_start@,ps_eoj_at_end@" to the end of the ifhp=
> > > string doesn't help.
> > >
> > > The "lpq -Piss -L" output is attached (where the first job has the default
> > > ps_eoj* settings and the second has the ps_eoj*@ stuff).
> > >
> > > Why would the printer be so upset about the ^D ?
> >
> > I don't know... but I have found a possible cause... Please get
> > ifhp-3.5.8 (next release) and try it.
> >
> > Patrick Powell Astart Technologies,
> > [EMAIL PROTECTED] 9475 Chesapeake Drive, Suite D,
> > Network and System San Diego, CA 92123
> > Consulting 858-874-6543 FAX 858-279-8424
> > LPRng - Print Spooler (http://www.lprng.com)
>
>
>
-----------------------------------------------------------------------------
YOU MUST BE A LIST MEMBER IN ORDER TO POST TO THE LPRNG MAILING LIST
The address you post from MUST be your subscription address
If you need help, send email to [EMAIL PROTECTED] (or lprng-requests
or lprng-digest-requests) with the word 'help' in the body. For the impatient,
to subscribe to a list with name LIST, send mail to [EMAIL PROTECTED]
with: | example:
subscribe LIST <mailaddr> | subscribe lprng-digest [EMAIL PROTECTED]
unsubscribe LIST <mailaddr> | unsubscribe lprng [EMAIL PROTECTED]
If you have major problems, send email to [EMAIL PROTECTED] with the word
LPRNGLIST in the SUBJECT line.
-----------------------------------------------------------------------------