Diffs for BSD 4.3-Tahoe lpr/lpd on SGI
Philip Budne
budd at bu-cs.BU.EDU
Wed Aug 2 07:16:01 AEST 1989
Here are diffs to the 4.3-Tahoe lpr/lpd available from UUNET to allow
it to be used on an SGI machine. Here are the particulars of the
system on which I ported it;
grizzly% uname -a
grizzly grizzly 4D1-3.1F 04141631 IP5
It has NOT been used to drive local printers at all, but only to
provide access to printers on BSD hosts.
Some assembly required -- and remember, you get what you pay for! I
don't read this group, but would be happy to hear about real fixes or
improvements via mail.
Phil Budne, Boston University
budd at bu-it.bu.edu
{mit-eddie,harvard}!buita!budd
================ snip here (actually I just use "unshar")
#! /bin/sh
# This is a shell archive. Remove anything before this line, then unpack
# it by saving it into a file and typing "sh file". To overwrite existing
# files, type "sh file -c". You can also feed this as standard input via
# unshar, or by typing "sh <file", e.g.. If this archive is complete, you
# will see the following message at the end:
# "End of shell archive."
# Contents: Makefile.diff README.BU cmds.c.diff cmdtab.c.diff
# displayq.c.diff lp.h.diff lp.local.h.diff lpc.c.diff lpd.c.diff
# lpr.c.diff printjob.c.diff recvjob.c.diff startdaemon.c.diff
# Wrapped by budd at bu-pub on Tue Aug 1 16:12:44 1989
PATH=/bin:/usr/bin:/usr/ucb ; export PATH
if test -f Makefile.diff -a "${1}" != "-c" ; then
echo shar: Will not over-write existing file \"Makefile.diff\"
else
echo shar: Extracting \"Makefile.diff\" \(7606 characters\)
sed "s/^X//" >Makefile.diff <<'END_OF_Makefile.diff'
X*** Makefile.orig Thu Sep 29 12:29:09 1988
X--- Makefile Mon Jul 17 15:49:53 1989
X***************
X*** 21,29
X # DAEMON someone special
X # SPGRP the group id of the spooling programs
X #
X! CFLAGS= -O
X! LIBDIR= /usr/lib
X! BINDIR= /usr/ucb
X SPLDIR= /usr/spool/lpd
X DAEMON= daemon
X SPGRP= daemon
X
X--- 21,30 -----
X # DAEMON someone special
X # SPGRP the group id of the spooling programs
X #
X! CFLAGS= -g -I/usr/include/bsd
X! LIBDIR= /usr/local/lib
X! BINDIR= /usr/local/bin
X! ETCDIR= /usr/local/etc
X SPLDIR= /usr/spool/lpd
X DAEMON= daemon
X SPGRP= daemon
X***************
X*** 27,33
X SPLDIR= /usr/spool/lpd
X DAEMON= daemon
X SPGRP= daemon
X! LIBC= /lib/libc.a
X L1SRCS= lpd.c printjob.c recvjob.c displayq.c rmjob.c startdaemon.c \
X lpdchar.c common.c printcap.c
X L1OBJS= lpd.o printjob.o recvjob.o displayq.o rmjob.o startdaemon.o \
X
X--- 28,34 -----
X SPLDIR= /usr/spool/lpd
X DAEMON= daemon
X SPGRP= daemon
X! #LIBC= /lib/libc.a
X L1SRCS= lpd.c printjob.c recvjob.c displayq.c rmjob.c startdaemon.c \
X lpdchar.c common.c printcap.c
X L1OBJS= lpd.o printjob.o recvjob.o displayq.o rmjob.o startdaemon.o \
X***************
X*** 32,39
X lpdchar.c common.c printcap.c
X L1OBJS= lpd.o printjob.o recvjob.o displayq.o rmjob.o startdaemon.o \
X lpdchar.o common.o printcap.o
X! L2SRCS= lpr.c startdaemon.c printcap.c
X! L2OBJS= lpr.o startdaemon.o printcap.o
X L3SRCS= lpq.c displayq.c common.c printcap.c
X L3OBJS= lpq.o displayq.o common.o printcap.o
X L4SRCS= lprm.c rmjob.c startdaemon.c common.c printcap.c
X
X--- 33,40 -----
X lpdchar.c common.c printcap.c
X L1OBJS= lpd.o printjob.o recvjob.o displayq.o rmjob.o startdaemon.o \
X lpdchar.o common.o printcap.o
X! L2SRCS= lpr.c startdaemon.c printcap.c common.c
X! L2OBJS= lpr.o startdaemon.o printcap.o common.o
X L3SRCS= lpq.c displayq.c common.c printcap.c
X L3OBJS= lpq.o displayq.o common.o printcap.o
X L4SRCS= lprm.c rmjob.c startdaemon.c common.c printcap.c
X***************
X*** 53,59
X MAN= ${MAN1} ${MAN8}
X ALL= lpd lpr lpq lprm lpc lptest pac
X
X! all: ${ALL} FILTERS VFILTERS
X
X lpd: ${L1OBJS} ${LIBC}
X ${CC} -o $@ ${L1OBJS}
X
X--- 54,61 -----
X MAN= ${MAN1} ${MAN8}
X ALL= lpd lpr lpq lprm lpc lptest pac
X
X! #all: ${ALL} FILTERS VFILTERS
X! all: ${ALL}
X
X lpd: ${L1OBJS} ${LIBC}
X ${CC} -o $@ ${L1OBJS} -lbsd
X***************
X*** 56,62
X all: ${ALL} FILTERS VFILTERS
X
X lpd: ${L1OBJS} ${LIBC}
X! ${CC} -o $@ ${L1OBJS}
X
X lpr: ${L2OBJS} ${LIBC}
X ${CC} -o $@ ${L2OBJS}
X
X--- 58,64 -----
X all: ${ALL}
X
X lpd: ${L1OBJS} ${LIBC}
X! ${CC} -o $@ ${L1OBJS} -lbsd
X
X lpr: ${L2OBJS} ${LIBC}
X ${CC} -o $@ ${L2OBJS} -lbsd
X***************
X*** 59,65
X ${CC} -o $@ ${L1OBJS}
X
X lpr: ${L2OBJS} ${LIBC}
X! ${CC} -o $@ ${L2OBJS}
X
X lpq: ${L3OBJS} ${LIBC}
X ${CC} -o $@ ${L3OBJS}
X
X--- 61,67 -----
X ${CC} -o $@ ${L1OBJS} -lbsd
X
X lpr: ${L2OBJS} ${LIBC}
X! ${CC} -o $@ ${L2OBJS} -lbsd
X
X lpq: ${L3OBJS} ${LIBC}
X ${CC} -o $@ ${L3OBJS} -lbsd
X***************
X*** 62,68
X ${CC} -o $@ ${L2OBJS}
X
X lpq: ${L3OBJS} ${LIBC}
X! ${CC} -o $@ ${L3OBJS}
X
X lprm: ${L4OBJS} ${LIBC}
X ${CC} -o $@ ${L4OBJS}
X
X--- 64,70 -----
X ${CC} -o $@ ${L2OBJS} -lbsd
X
X lpq: ${L3OBJS} ${LIBC}
X! ${CC} -o $@ ${L3OBJS} -lbsd
X
X lprm: ${L4OBJS} ${LIBC}
X ${CC} -o $@ ${L4OBJS} -lbsd
X***************
X*** 65,71
X ${CC} -o $@ ${L3OBJS}
X
X lprm: ${L4OBJS} ${LIBC}
X! ${CC} -o $@ ${L4OBJS}
X
X lpc: ${L5OBJS} ${LIBC}
X ${CC} -o $@ ${L5OBJS}
X
X--- 67,73 -----
X ${CC} -o $@ ${L3OBJS} -lbsd
X
X lprm: ${L4OBJS} ${LIBC}
X! ${CC} -o $@ ${L4OBJS} -lbsd
X
X lpc: ${L5OBJS} ${LIBC}
X ${CC} -o $@ ${L5OBJS} -lbsd
X***************
X*** 68,74
X ${CC} -o $@ ${L4OBJS}
X
X lpc: ${L5OBJS} ${LIBC}
X! ${CC} -o $@ ${L5OBJS}
X
X lptest: ${L6OBJS} ${LIBC}
X ${CC} ${CFLAGS} -o $@ ${L6OBJS}
X
X--- 70,76 -----
X ${CC} -o $@ ${L4OBJS} -lbsd
X
X lpc: ${L5OBJS} ${LIBC}
X! ${CC} -o $@ ${L5OBJS} -lbsd
X
X lptest: ${L6OBJS} ${LIBC}
X ${CC} ${CFLAGS} -o $@ ${L6OBJS} -lbsd
X***************
X*** 71,77
X ${CC} -o $@ ${L5OBJS}
X
X lptest: ${L6OBJS} ${LIBC}
X! ${CC} ${CFLAGS} -o $@ ${L6OBJS}
X
X pac: ${L7OBJS} ${LIBC}
X ${CC} -o $@ ${L7OBJS}
X
X--- 73,79 -----
X ${CC} -o $@ ${L5OBJS} -lbsd
X
X lptest: ${L6OBJS} ${LIBC}
X! ${CC} ${CFLAGS} -o $@ ${L6OBJS} -lbsd
X
X pac: ${L7OBJS} ${LIBC}
X ${CC} -o $@ ${L7OBJS} -lbsd
X***************
X*** 74,80
X ${CC} ${CFLAGS} -o $@ ${L6OBJS}
X
X pac: ${L7OBJS} ${LIBC}
X! ${CC} -o $@ ${L7OBJS}
X
X FILTERS:
X cd filters; make ${MFLAGS}
X
X--- 76,82 -----
X ${CC} ${CFLAGS} -o $@ ${L6OBJS} -lbsd
X
X pac: ${L7OBJS} ${LIBC}
X! ${CC} -o $@ ${L7OBJS} -lbsd
X
X FILTERS:
X cd filters; make ${MFLAGS}
X***************
X*** 97,103
X cd filters; make ${MFLAGS} depend
X cd vfilters; make ${MFLAGS} depend
X
X! install: ${MAN}
X install -s -o root -g ${SPGRP} -m 6711 lpd ${DESTDIR}/${LIBDIR}/lpd
X install -s -o root -g ${SPGRP} -m 6711 lpr ${DESTDIR}/${BINDIR}/lpr
X install -s -o root -g ${SPGRP} -m 6711 lpq ${DESTDIR}/${BINDIR}/lpq
X
X--- 99,106 -----
X cd filters; make ${MFLAGS} depend
X cd vfilters; make ${MFLAGS} depend
X
X! #install: ${MAN}
X! install:
X install -s -o root -g ${SPGRP} -m 6711 lpd ${DESTDIR}/${LIBDIR}/lpd
X install -s -o root -g ${SPGRP} -m 6711 lpr ${DESTDIR}/${BINDIR}/lpr
X install -s -o root -g ${SPGRP} -m 6711 lpq ${DESTDIR}/${BINDIR}/lpq
X***************
X*** 102,108
X install -s -o root -g ${SPGRP} -m 6711 lpr ${DESTDIR}/${BINDIR}/lpr
X install -s -o root -g ${SPGRP} -m 6711 lpq ${DESTDIR}/${BINDIR}/lpq
X install -s -o root -g ${SPGRP} -m 6711 lprm ${DESTDIR}/${BINDIR}/lprm
X! install -s -o bin -g ${SPGRP} -m 2711 lpc ${DESTDIR}/etc/lpc
X install -s -o bin -g bin -m 755 lptest ${DESTDIR}/${BINDIR}/lptest
X install -s -o bin -g bin -m 755 pac ${DESTDIR}/etc/pac
X /etc/chown ${DAEMON} ${DESTDIR}/${SPLDIR}
X
X--- 105,111 -----
X install -s -o root -g ${SPGRP} -m 6711 lpr ${DESTDIR}/${BINDIR}/lpr
X install -s -o root -g ${SPGRP} -m 6711 lpq ${DESTDIR}/${BINDIR}/lpq
X install -s -o root -g ${SPGRP} -m 6711 lprm ${DESTDIR}/${BINDIR}/lprm
X! install -s -o bin -g ${SPGRP} -m 2711 lpc ${DESTDIR}/${ETCDIR}/lpc
X install -s -o bin -g bin -m 755 lptest ${DESTDIR}/${BINDIR}/lptest
X install -s -o bin -g bin -m 755 pac ${DESTDIR}/${ETCDIR}/pac
X
X***************
X*** 104,117
X install -s -o root -g ${SPGRP} -m 6711 lprm ${DESTDIR}/${BINDIR}/lprm
X install -s -o bin -g ${SPGRP} -m 2711 lpc ${DESTDIR}/etc/lpc
X install -s -o bin -g bin -m 755 lptest ${DESTDIR}/${BINDIR}/lptest
X! install -s -o bin -g bin -m 755 pac ${DESTDIR}/etc/pac
X! /etc/chown ${DAEMON} ${DESTDIR}/${SPLDIR}
X! chgrp ${SPGRP} ${DESTDIR}/${SPLDIR}
X! chmod 775 ${DESTDIR}/${SPLDIR}
X! install -c -o bin -g bin -m 444 ${MAN1} ${DESTDIR}/usr/man/cat1
X! install -c -o bin -g bin -m 444 ${MAN8} ${DESTDIR}/usr/man/cat8
X! cd filters; make ${MFLAGS} DESTDIR=${DESTDIR} install
X! cd vfilters; make ${MFLAGS} DESTDIR=${DESTDIR} install
X
X lint: ${SRCS}
X lint ${CFLAGS} ${L1SRCS}
X
X--- 107,121 -----
X install -s -o root -g ${SPGRP} -m 6711 lprm ${DESTDIR}/${BINDIR}/lprm
X install -s -o bin -g ${SPGRP} -m 2711 lpc ${DESTDIR}/${ETCDIR}/lpc
X install -s -o bin -g bin -m 755 lptest ${DESTDIR}/${BINDIR}/lptest
X! install -s -o bin -g bin -m 755 pac ${DESTDIR}/${ETCDIR}/pac
X!
X! # /etc/chown ${DAEMON} ${DESTDIR}/${SPLDIR}
X! # chgrp ${SPGRP} ${DESTDIR}/${SPLDIR}
X! # chmod 775 ${DESTDIR}/${SPLDIR}
X! # install -c -o bin -g bin -m 444 ${MAN1} ${DESTDIR}/usr/man/cat1
X! # install -c -o bin -g bin -m 444 ${MAN8} ${DESTDIR}/usr/man/cat8
X! # cd filters; make ${MFLAGS} DESTDIR=${DESTDIR} install
X! # cd vfilters; make ${MFLAGS} DESTDIR=${DESTDIR} install
X
X lint: ${SRCS}
X lint ${CFLAGS} ${L1SRCS}
END_OF_Makefile.diff
if test 7606 -ne `wc -c <Makefile.diff`; then
echo shar: \"Makefile.diff\" unpacked with wrong size!
fi
# end of overwriting check
fi
if test -f README.BU -a "${1}" != "-c" ; then
echo shar: Will not over-write existing file \"README.BU\"
else
echo shar: Extracting \"README.BU\" \(509 characters\)
sed "s/^X//" >README.BU <<'END_OF_README.BU'
X4.3 Tahoe lpr/lpd (from uunet) hacked for SGI/Irix
X
Xprintcap capabilities for terminal mode bits (fc, fs, xc, xs) have not
Xbeen implemented! We do not use local printers on our SGIs. (Why not
Xuse the native lp?)
X
XSimulation of BSD fc/fs/xc/xs would allow quicker porting of BSD
Xfilters and printcap files, but not the full latitude of termio modes.
X
XAllowing full access to termio would require;
X {set,clear} x {cflags,iflags,oflags,lflags}
X VMIN
X VTIME
X
Xie; 10 capabilities.
X
X Phil Budne
X Boston University
END_OF_README.BU
if test 509 -ne `wc -c <README.BU`; then
echo shar: \"README.BU\" unpacked with wrong size!
fi
# end of overwriting check
fi
if test -f cmds.c.diff -a "${1}" != "-c" ; then
echo shar: Will not over-write existing file \"cmds.c.diff\"
else
echo shar: Extracting \"cmds.c.diff\" \(631 characters\)
sed "s/^X//" >cmds.c.diff <<'END_OF_cmds.c.diff'
X*** cmds.c.orig Thu Jun 30 21:00:19 1988
X--- cmds.c Mon Jul 17 14:58:31 1989
X***************
X*** 160,166
X }
X }
X
X! select(d)
X struct direct *d;
X {
X int c = d->d_name[0];
X
X--- 160,166 -----
X }
X }
X
X! Select(d)
X struct direct *d;
X {
X int c = d->d_name[0];
X***************
X*** 211,217
X ;
X lp[-1] = '/';
X
X! nitems = scandir(SD, &queue, select, sortq);
X if (nitems < 0) {
X printf("\tcannot examine spool directory\n");
X return;
X
X--- 211,217 -----
X ;
X lp[-1] = '/';
X
X! nitems = scandir(SD, &queue, Select, sortq);
X if (nitems < 0) {
X printf("\tcannot examine spool directory\n");
X return;
END_OF_cmds.c.diff
if test 631 -ne `wc -c <cmds.c.diff`; then
echo shar: \"cmds.c.diff\" unpacked with wrong size!
fi
# end of overwriting check
fi
if test -f cmdtab.c.diff -a "${1}" != "-c" ; then
echo shar: Will not over-write existing file \"cmdtab.c.diff\"
else
echo shar: Extracting \"cmdtab.c.diff\" \(279 characters\)
sed "s/^X//" >cmdtab.c.diff <<'END_OF_cmdtab.c.diff'
X*** cmdtab.c.orig Thu Jun 30 21:00:19 1988
X--- cmdtab.c Mon Jul 17 15:00:52 1989
X***************
X*** 61,64
X { 0 },
X };
X
X! int NCMDS = sizeof (cmdtab) / sizeof (cmdtab[0]);
X
X--- 61,64 -----
X { 0 },
X };
X
X! int NCMDS = sizeof (cmdtab) / sizeof (cmdtab[0]) - 1; /* budd */
END_OF_cmdtab.c.diff
if test 279 -ne `wc -c <cmdtab.c.diff`; then
echo shar: \"cmdtab.c.diff\" unpacked with wrong size!
fi
# end of overwriting check
fi
if test -f displayq.c.diff -a "${1}" != "-c" ; then
echo shar: Will not over-write existing file \"displayq.c.diff\"
else
echo shar: Extracting \"displayq.c.diff\" \(1197 characters\)
sed "s/^X//" >displayq.c.diff <<'END_OF_displayq.c.diff'
X*** displayq.c.orig Thu Jun 30 21:00:20 1988
X--- displayq.c Mon Jul 17 16:07:38 1989
X***************
X*** 154,159
X warn();
X else {
X register char *cp;
X
X /* get daemon pid */
X cp = current;
X
X--- 154,160 -----
X warn();
X else {
X register char *cp;
X+ register c;
X
X /* get daemon pid */
X cp = current;
X***************
X*** 157,164
X
X /* get daemon pid */
X cp = current;
X! while ((*cp = getc(fp)) != EOF && *cp != '\n')
X! cp++;
X *cp = '\0';
X i = atoi(current);
X if (i <= 0 || kill(i, 0) < 0)
X
X--- 158,165 -----
X
X /* get daemon pid */
X cp = current;
X! while ((c = getc(fp)) != EOF && c != '\n')
X! *cp++ = c;
X *cp = '\0';
X i = atoi(current);
X if (i <= 0 || kill(i, 0) < 0)
X***************
X*** 166,173
X else {
X /* read current file name */
X cp = current;
X! while ((*cp = getc(fp)) != EOF && *cp != '\n')
X! cp++;
X *cp = '\0';
X /*
X * Print the status file.
X
X--- 167,174 -----
X else {
X /* read current file name */
X cp = current;
X! while ((c = getc(fp)) != EOF && c != '\n')
X! *cp++ = c;
X *cp = '\0';
X /*
X * Print the status file.
END_OF_displayq.c.diff
if test 1197 -ne `wc -c <displayq.c.diff`; then
echo shar: \"displayq.c.diff\" unpacked with wrong size!
fi
# end of overwriting check
fi
if test -f lp.h.diff -a "${1}" != "-c" ; then
echo shar: Will not over-write existing file \"lp.h.diff\"
else
echo shar: Extracting \"lp.h.diff\" \(778 characters\)
sed "s/^X//" >lp.h.diff <<'END_OF_lp.h.diff'
X*** lp.h.orig Thu Jun 30 21:00:21 1988
X--- lp.h Sun Jul 16 01:07:57 1989
X***************
X*** 27,32
X #include <sys/dir.h>
X #include <sys/stat.h>
X #include <sys/socket.h>
X #include <sys/un.h>
X #include <netinet/in.h>
X #include <netdb.h>
X
X--- 27,33 -----
X #include <sys/dir.h>
X #include <sys/stat.h>
X #include <sys/socket.h>
X+ #ifndef sgi /* budd */
X #include <sys/un.h>
X #endif /* budd */
X #include <netinet/in.h>
X***************
X*** 28,33
X #include <sys/stat.h>
X #include <sys/socket.h>
X #include <sys/un.h>
X #include <netinet/in.h>
X #include <netdb.h>
X #include <pwd.h>
X
X--- 29,35 -----
X #include <sys/socket.h>
X #ifndef sgi /* budd */
X #include <sys/un.h>
X+ #endif /* budd */
X #include <netinet/in.h>
X #include <netdb.h>
X #include <pwd.h>
END_OF_lp.h.diff
if test 778 -ne `wc -c <lp.h.diff`; then
echo shar: \"lp.h.diff\" unpacked with wrong size!
fi
# end of overwriting check
fi
if test -f lp.local.h.diff -a "${1}" != "-c" ; then
echo shar: Will not over-write existing file \"lp.local.h.diff\"
else
echo shar: Extracting \"lp.local.h.diff\" \(2417 characters\)
sed "s/^X//" >lp.local.h.diff <<'END_OF_lp.local.h.diff'
X*** lp.local.h.orig Thu Jun 30 21:00:21 1988
X--- lp.local.h Mon Jul 17 15:57:25 1989
X***************
X*** 29,34
X #include <a.out.h>
X #include <ar.h>
X
X #ifndef A_MAGIC1 /* must be a VM/UNIX system */
X # define A_MAGIC1 OMAGIC
X # define A_MAGIC2 NMAGIC
X
X--- 29,35 -----
X #include <a.out.h>
X #include <ar.h>
X
X+ #ifndef sgi
X #ifndef A_MAGIC1 /* must be a VM/UNIX system */
X # define A_MAGIC1 OMAGIC
X # define A_MAGIC2 NMAGIC
X***************
X*** 36,41
X # undef ARMAG
X # define ARMAG 0177545
X #endif
X
X /*
X * Defaults for line printer capabilities data base
X
X--- 37,43 -----
X # undef ARMAG
X # define ARMAG 0177545
X #endif
X+ #endif
X
X /*
X * Defaults for line printer capabilities data base
X***************
X*** 44,50
X #define DEFLOCK "lock"
X #define DEFSTAT "status"
X #define DEFSPOOL "/usr/spool/lpd"
X! #define DEFDAEMON "/usr/lib/lpd"
X #define DEFLOGF "/dev/console"
X #define DEFDEVLP "/dev/lp"
X #define DEFRLPR "/usr/lib/rlpr"
X
X--- 46,52 -----
X #define DEFLOCK "lock"
X #define DEFSTAT "status"
X #define DEFSPOOL "/usr/spool/lpd"
X! #define DEFDAEMON "/usr/lib/lpd" /* budd: never used? */
X #define DEFLOGF "/dev/console"
X #define DEFDEVLP "/dev/lp"
X #define DEFRLPR "/usr/lib/rlpr"
X***************
X*** 48,54
X #define DEFLOGF "/dev/console"
X #define DEFDEVLP "/dev/lp"
X #define DEFRLPR "/usr/lib/rlpr"
X! #define DEFBINDIR "/usr/ucb"
X #define DEFMX 1000
X #define DEFMAXCOPIES 0
X #define DEFFF "\f"
X
X--- 50,56 -----
X #define DEFLOGF "/dev/console"
X #define DEFDEVLP "/dev/lp"
X #define DEFRLPR "/usr/lib/rlpr"
X! #define DEFBINDIR "/usr/ucb" /* budd: never used? */
X #define DEFMX 1000
X #define DEFMAXCOPIES 0
X #define DEFFF "\f"
X***************
X*** 77,82
X /*
X * path name of files created by lpd.
X */
X #define MASTERLOCK "/usr/spool/lpd.lock"
X #define SOCKETNAME "/dev/printer"
X
X
X--- 79,88 -----
X /*
X * path name of files created by lpd.
X */
X+ #ifdef sgi
X+ /* budd: keep everything under /usr/spool/lpd */
X+ #define MASTERLOCK "/usr/spool/lpd/lpd.lock"
X+ #else
X #define MASTERLOCK "/usr/spool/lpd.lock"
X #endif
X
X***************
X*** 78,83
X * path name of files created by lpd.
X */
X #define MASTERLOCK "/usr/spool/lpd.lock"
X #define SOCKETNAME "/dev/printer"
X
X /*
X
X--- 84,91 -----
X #define MASTERLOCK "/usr/spool/lpd/lpd.lock"
X #else
X #define MASTERLOCK "/usr/spool/lpd.lock"
X+ #endif
X+
X #define SOCKETNAME "/dev/printer"
X
X /*
END_OF_lp.local.h.diff
if test 2417 -ne `wc -c <lp.local.h.diff`; then
echo shar: \"lp.local.h.diff\" unpacked with wrong size!
fi
# end of overwriting check
fi
if test -f lpc.c.diff -a "${1}" != "-c" ; then
echo shar: Will not over-write existing file \"lpc.c.diff\"
else
echo shar: Extracting \"lpc.c.diff\" \(437 characters\)
sed "s/^X//" >lpc.c.diff <<'END_OF_lpc.c.diff'
X*** lpc.c.orig Sun Nov 20 22:11:03 1988
X--- lpc.c Mon Jul 17 14:55:45 1989
X***************
X*** 109,114
X quit();
X if (cmdline[0] == 0)
X break;
X makeargv();
X c = getcmd(margv[0]);
X if (c == (struct cmd *)-1) {
X
X--- 109,116 -----
X quit();
X if (cmdline[0] == 0)
X break;
X+ if (cmdline[0] == '\n') /* budd */
X+ continue; /* budd */
X makeargv();
X c = getcmd(margv[0]);
X if (c == (struct cmd *)-1) {
END_OF_lpc.c.diff
if test 437 -ne `wc -c <lpc.c.diff`; then
echo shar: \"lpc.c.diff\" unpacked with wrong size!
fi
# end of overwriting check
fi
if test -f lpd.c.diff -a "${1}" != "-c" ; then
echo shar: Will not over-write existing file \"lpd.c.diff\"
else
echo shar: Extracting \"lpd.c.diff\" \(4953 characters\)
sed "s/^X//" >lpd.c.diff <<'END_OF_lpd.c.diff'
X*** lpd.c.orig Thu Jun 30 21:00:22 1988
X--- lpd.c Sun Jul 16 01:13:37 1989
X***************
X*** 65,71
X int argc;
X char **argv;
X {
X! int f, funix, finet, options, defreadfds, fromlen;
X struct sockaddr_un sun, fromunix;
X struct sockaddr_in sin, frominet;
X int omask, lfd;
X
X--- 65,73 -----
X int argc;
X char **argv;
X {
X! int f, finet, options, defreadfds, fromlen;
X! # ifndef sgi
X! int funix;
X struct sockaddr_un sun, fromunix;
X # endif
X struct sockaddr_in sin, frominet;
X***************
X*** 67,72
X {
X int f, funix, finet, options, defreadfds, fromlen;
X struct sockaddr_un sun, fromunix;
X struct sockaddr_in sin, frominet;
X int omask, lfd;
X
X
X--- 69,75 -----
X # ifndef sgi
X int funix;
X struct sockaddr_un sun, fromunix;
X+ # endif
X struct sockaddr_in sin, frominet;
X int omask, lfd;
X
X***************
X*** 127,132
X syslog(LOG_ERR, "%s: %m", MASTERLOCK);
X exit(1);
X }
X signal(SIGCHLD, reapchild);
X /*
X * Restart all the printers.
X
X--- 130,139 -----
X syslog(LOG_ERR, "%s: %m", MASTERLOCK);
X exit(1);
X }
X+ # ifdef Xsgi
X+ signal(SIGCLD, SIG_IGN); /* never make zombies */
X+ /* doesn't seem to work */
X+ # else
X signal(SIGCHLD, reapchild);
X # endif
X /*
X***************
X*** 128,133
X exit(1);
X }
X signal(SIGCHLD, reapchild);
X /*
X * Restart all the printers.
X */
X
X--- 135,141 -----
X /* doesn't seem to work */
X # else
X signal(SIGCHLD, reapchild);
X+ # endif
X /*
X * Restart all the printers.
X */
X***************
X*** 132,137
X * Restart all the printers.
X */
X startup();
X (void) unlink(SOCKETNAME);
X funix = socket(AF_UNIX, SOCK_STREAM, 0);
X if (funix < 0) {
X
X--- 140,146 -----
X * Restart all the printers.
X */
X startup();
X+ # ifndef sgi
X (void) unlink(SOCKETNAME);
X funix = socket(AF_UNIX, SOCK_STREAM, 0);
X if (funix < 0) {
X***************
X*** 153,158
X sigsetmask(omask);
X defreadfds = 1 << funix;
X listen(funix, 5);
X finet = socket(AF_INET, SOCK_STREAM, 0);
X if (finet >= 0) {
X struct servent *sp;
X
X--- 162,168 -----
X sigsetmask(omask);
X defreadfds = 1 << funix;
X listen(funix, 5);
X+ # endif
X finet = socket(AF_INET, SOCK_STREAM, 0);
X if (finet >= 0) {
X struct servent *sp;
X***************
X*** 188,193
X syslog(LOG_WARNING, "select: %m");
X continue;
X }
X if (readfds & (1 << funix)) {
X domain = AF_UNIX, fromlen = sizeof(fromunix);
X s = accept(funix, &fromunix, &fromlen);
X
X--- 198,204 -----
X syslog(LOG_WARNING, "select: %m");
X continue;
X }
X+ # ifndef sgi
X if (readfds & (1 << funix)) {
X domain = AF_UNIX, fromlen = sizeof(fromunix);
X s = accept(funix, &fromunix, &fromlen);
X***************
X*** 191,197
X if (readfds & (1 << funix)) {
X domain = AF_UNIX, fromlen = sizeof(fromunix);
X s = accept(funix, &fromunix, &fromlen);
X! } else if (readfds & (1 << finet)) {
X domain = AF_INET, fromlen = sizeof(frominet);
X s = accept(finet, &frominet, &fromlen);
X }
X
X--- 202,210 -----
X if (readfds & (1 << funix)) {
X domain = AF_UNIX, fromlen = sizeof(fromunix);
X s = accept(funix, &fromunix, &fromlen);
X! } else
X! # endif
X! if (readfds & (1 << finet)) {
X domain = AF_INET, fromlen = sizeof(frominet);
X s = accept(finet, &frominet, &fromlen);
X }
X***************
X*** 206,211
X signal(SIGINT, SIG_IGN);
X signal(SIGQUIT, SIG_IGN);
X signal(SIGTERM, SIG_IGN);
X (void) close(funix);
X (void) close(finet);
X dup2(s, 1);
X
X--- 219,225 -----
X signal(SIGINT, SIG_IGN);
X signal(SIGQUIT, SIG_IGN);
X signal(SIGTERM, SIG_IGN);
X+ # ifndef sgi
X (void) close(funix);
X # endif
X (void) close(finet);
X***************
X*** 207,212
X signal(SIGQUIT, SIG_IGN);
X signal(SIGTERM, SIG_IGN);
X (void) close(funix);
X (void) close(finet);
X dup2(s, 1);
X (void) close(s);
X
X--- 221,227 -----
X signal(SIGTERM, SIG_IGN);
X # ifndef sgi
X (void) close(funix);
X+ # endif
X (void) close(finet);
X dup2(s, 1);
X (void) close(s);
X***************
X*** 222,228
X reapchild()
X {
X union wait status;
X-
X while (wait3(&status, WNOHANG, 0) > 0)
X ;
X }
X
X--- 237,242 -----
X reapchild()
X {
X union wait status;
X while (wait3(&status, WNOHANG, 0) > 0)
X ;
X }
X***************
X*** 401,406
X f->sin_port = ntohs(f->sin_port);
X if (f->sin_family != AF_INET || f->sin_port >= IPPORT_RESERVED)
X fatal("Malformed from address");
X hp = gethostbyaddr(&f->sin_addr, sizeof(struct in_addr), f->sin_family);
X if (hp == 0)
X fatal("Host name for your address (%s) unknown",
X
X--- 415,424 -----
X f->sin_port = ntohs(f->sin_port);
X if (f->sin_family != AF_INET || f->sin_port >= IPPORT_RESERVED)
X fatal("Malformed from address");
X+ # ifdef sgi
X+ if( inet_netof( f->sin_addr ) == 127 ) /* loopback? */
X+ return;
X+ # endif
X hp = gethostbyaddr(&f->sin_addr, sizeof(struct in_addr), f->sin_family);
X if (hp == 0)
X fatal("Host name for your address (%s) unknown",
END_OF_lpd.c.diff
if test 4953 -ne `wc -c <lpd.c.diff`; then
echo shar: \"lpd.c.diff\" unpacked with wrong size!
fi
# end of overwriting check
fi
if test -f lpr.c.diff -a "${1}" != "-c" ; then
echo shar: Will not over-write existing file \"lpr.c.diff\"
else
echo shar: Extracting \"lpr.c.diff\" \(4879 characters\)
sed "s/^X//" >lpr.c.diff <<'END_OF_lpr.c.diff'
X*** lpr.c.orig Thu Jun 30 21:00:24 1988
X--- lpr.c Mon Jul 17 15:46:58 1989
X***************
X*** 90,95
X char *argv[];
X {
X extern struct passwd *getpwuid();
X struct passwd *pw;
X struct group *gptr;
X extern char *itoa();
X
X--- 90,98 -----
X char *argv[];
X {
X extern struct passwd *getpwuid();
X+ # ifdef sgi
X+ extern struct group *getgrnam();
X+ # endif
X struct passwd *pw;
X struct group *gptr;
X extern char *itoa();
X***************
X*** 258,263
X */
X mktemps();
X tfd = nfile(tfname);
X (void) fchown(tfd, DU, -1); /* owned by daemon for protection */
X card('H', host);
X card('P', person);
X
X--- 261,269 -----
X */
X mktemps();
X tfd = nfile(tfname);
X+ # ifdef sgi
X+ (void) chown(tfname, DU, -1); /* owned by daemon for protection */
X+ # else
X (void) fchown(tfd, DU, -1); /* owned by daemon for protection */
X # endif
X card('H', host);
X***************
X*** 259,264
X mktemps();
X tfd = nfile(tfname);
X (void) fchown(tfd, DU, -1); /* owned by daemon for protection */
X card('H', host);
X card('P', person);
X if (hdr) {
X
X--- 265,271 -----
X (void) chown(tfname, DU, -1); /* owned by daemon for protection */
X # else
X (void) fchown(tfd, DU, -1); /* owned by daemon for protection */
X+ # endif
X card('H', host);
X card('P', person);
X if (hdr) {
X***************
X*** 462,467
X printf("%s: cannot create %s\n", name, n);
X cleanup();
X }
X if (fchown(f, userid, -1) < 0) {
X printf("%s: cannot chown %s\n", name, n);
X cleanup();
X
X--- 469,480 -----
X printf("%s: cannot create %s\n", name, n);
X cleanup();
X }
X+ # ifdef sgi
X+ if (chown(n, userid, -1) < 0) {
X+ printf("%s: cannot chown %s\n", name, n);
X+ cleanup();
X+ }
X+ # else
X if (fchown(f, userid, -1) < 0) {
X printf("%s: cannot chown %s\n", name, n);
X cleanup();
X***************
X*** 466,471
X printf("%s: cannot chown %s\n", name, n);
X cleanup();
X }
X if (++n[inchar] > 'z') {
X if (++n[inchar-2] == 't') {
X printf("too many files - break up the job\n");
X
X--- 479,485 -----
X printf("%s: cannot chown %s\n", name, n);
X cleanup();
X }
X+ # endif
X if (++n[inchar] > 'z') {
X if (++n[inchar-2] == 't') {
X printf("too many files - break up the job\n");
X***************
X*** 515,520
X test(file)
X char *file;
X {
X struct exec execb;
X register int fd;
X register char *cp;
X
X--- 529,543 -----
X test(file)
X char *file;
X {
X+ # ifdef sgi
X+ union {
X+ unsigned short ma_short;
X+ struct filehdr ma_f;
X+ # ifdef SARMAG
X+ char ma_str[ SARMAG ];
X+ # endif
X+ } magic;
X+ # else /* BSD, COFF pdp-11/ibm370 */
X struct exec execb;
X # endif
X register int fd;
X***************
X*** 516,521
X char *file;
X {
X struct exec execb;
X register int fd;
X register char *cp;
X
X
X--- 539,545 -----
X } magic;
X # else /* BSD, COFF pdp-11/ibm370 */
X struct exec execb;
X+ # endif
X register int fd;
X register char *cp;
X
X***************
X*** 539,544
X printf("%s: cannot open %s\n", name, file);
X return(-1);
X }
X if (read(fd, &execb, sizeof(execb)) == sizeof(execb))
X switch(execb.a_magic) {
X case A_MAGIC1:
X
X--- 563,590 -----
X printf("%s: cannot open %s\n", name, file);
X return(-1);
X }
X+
X+ # ifdef sgi
X+ /* if COFF file is shorter than SARMAG this can fail
X+ * seems a BIT unlikely!
X+ */
X+ if( read(fd, &magic, sizeof(magic)) == sizeof(magic) ) {
X+ if( ISCOFF(magic.ma_f.f_magic) ) {
X+ printf("%s: %s is an executable program", name, file);
X+ goto error1;
X+ }
X+ if(
X+ # ifdef SARMAG
X+ strncmp(magic.ma_str,ARMAG,SARMAG) == 0
X+ # else
X+ magic.ma_short == ARMAG
X+ # endif
X+ ) {
X+ printf("%s: %s is an archive file", name, file);
X+ goto error1;
X+ }
X+ } /* read ok */
X+ # else
X if (read(fd, &execb, sizeof(execb)) == sizeof(execb))
X switch(execb.a_magic) {
X case A_MAGIC1:
X***************
X*** 554,559
X printf("%s: %s is an archive file", name, file);
X goto error1;
X }
X (void) close(fd);
X if (rflag) {
X if ((cp = rindex(file, '/')) == NULL) {
X
X--- 600,606 -----
X printf("%s: %s is an archive file", name, file);
X goto error1;
X }
X+ # endif /* not sgi */
X (void) close(fd);
X
X if (rflag) {
X***************
X*** 555,560
X goto error1;
X }
X (void) close(fd);
X if (rflag) {
X if ((cp = rindex(file, '/')) == NULL) {
X if (access(".", 2) == 0)
X
X--- 602,608 -----
X }
X # endif /* not sgi */
X (void) close(fd);
X+
X if (rflag) {
X if ((cp = rindex(file, '/')) == NULL) {
X if (access(".", 2) == 0)
X***************
X*** 679,684
X return(s);
X }
X
X /*VARARGS1*/
X fatal(msg, a1, a2, a3)
X char *msg;
X
X--- 727,733 -----
X return(s);
X }
X
X+ # ifndef sgi /* sgi uses copy from common.c */
X /*VARARGS1*/
X fatal(msg, a1, a2, a3)
X char *msg;
X***************
X*** 688,690
X putchar('\n');
X exit(1);
X }
X
X--- 737,740 -----
X putchar('\n');
X exit(1);
X }
X+ # endif
END_OF_lpr.c.diff
if test 4879 -ne `wc -c <lpr.c.diff`; then
echo shar: \"lpr.c.diff\" unpacked with wrong size!
fi
# end of overwriting check
fi
if test -f printjob.c.diff -a "${1}" != "-c" ; then
echo shar: Will not over-write existing file \"printjob.c.diff\"
else
echo shar: Extracting \"printjob.c.diff\" \(6929 characters\)
sed "s/^X//" >printjob.c.diff <<'END_OF_printjob.c.diff'
X*** printjob.c.orig Thu Jun 30 21:00:26 1988
X--- printjob.c Sun Jul 16 02:47:40 1989
X***************
X*** 65,71
X char pxwidth[10] = "-x"; /* page width in pixels */
X char pxlength[10] = "-y"; /* page length in pixels */
X char indent[10] = "-i0"; /* indentation size in characters */
X! char tmpfile[] = "errsXXXXXX"; /* file name for filter output */
X
X printjob()
X {
X
X--- 65,71 -----
X char pxwidth[10] = "-x"; /* page width in pixels */
X char pxlength[10] = "-y"; /* page length in pixels */
X char indent[10] = "-i0"; /* indentation size in characters */
X! char TmpFile[] = "errsXXXXXX"; /* file name for filter output */
X
X printjob()
X {
X***************
X*** 92,98
X signal(SIGQUIT, abortpr);
X signal(SIGTERM, abortpr);
X
X! (void) mktemp(tmpfile);
X
X /*
X * uses short form file names
X
X--- 92,98 -----
X signal(SIGQUIT, abortpr);
X signal(SIGTERM, abortpr);
X
X! (void) mktemp(TmpFile);
X
X /*
X * uses short form file names
X***************
X*** 134,139
X if (nitems == 0) /* no work to do */
X exit(0);
X if (stb.st_mode & 01) { /* reset queue flag */
X if (fchmod(lfd, stb.st_mode & 0776) < 0)
X syslog(LOG_ERR, "%s: %s: %m", printer, LO);
X }
X
X--- 134,142 -----
X if (nitems == 0) /* no work to do */
X exit(0);
X if (stb.st_mode & 01) { /* reset queue flag */
X+ # ifdef sgi
X+ if (chmod(LO, stb.st_mode & 0776) < 0)
X+ # else
X if (fchmod(lfd, stb.st_mode & 0776) < 0)
X # endif
X syslog(LOG_ERR, "%s: %s: %m", printer, LO);
X***************
X*** 135,140
X exit(0);
X if (stb.st_mode & 01) { /* reset queue flag */
X if (fchmod(lfd, stb.st_mode & 0776) < 0)
X syslog(LOG_ERR, "%s: %s: %m", printer, LO);
X }
X openpr(); /* open printer or remote */
X
X--- 138,144 -----
X if (chmod(LO, stb.st_mode & 0776) < 0)
X # else
X if (fchmod(lfd, stb.st_mode & 0776) < 0)
X+ # endif
X syslog(LOG_ERR, "%s: %s: %m", printer, LO);
X }
X openpr(); /* open printer or remote */
X***************
X*** 170,175
X if (stb.st_mode & 01) {
X for (free((char *) q); nitems--; free((char *) q))
X q = *qp++;
X if (fchmod(lfd, stb.st_mode & 0776) < 0)
X syslog(LOG_WARNING, "%s: %s: %m",
X printer, LO);
X
X--- 174,182 -----
X if (stb.st_mode & 01) {
X for (free((char *) q); nitems--; free((char *) q))
X q = *qp++;
X+ # ifdef sgi
X+ if (chmod(LO, stb.st_mode & 0776) < 0)
X+ # else
X if (fchmod(lfd, stb.st_mode & 0776) < 0)
X # endif
X syslog(LOG_WARNING, "%s: %s: %m",
X***************
X*** 171,176
X for (free((char *) q); nitems--; free((char *) q))
X q = *qp++;
X if (fchmod(lfd, stb.st_mode & 0776) < 0)
X syslog(LOG_WARNING, "%s: %s: %m",
X printer, LO);
X break;
X
X--- 178,184 -----
X if (chmod(LO, stb.st_mode & 0776) < 0)
X # else
X if (fchmod(lfd, stb.st_mode & 0776) < 0)
X+ # endif
X syslog(LOG_WARNING, "%s: %s: %m",
X printer, LO);
X break;
X***************
X*** 210,216
X if (TR != NULL) /* output trailer */
X (void) write(ofd, TR, strlen(TR));
X }
X! (void) unlink(tmpfile);
X exit(0);
X }
X goto again;
X
X--- 218,224 -----
X if (TR != NULL) /* output trailer */
X (void) write(ofd, TR, strlen(TR));
X }
X! (void) unlink(TmpFile);
X exit(0);
X }
X goto again;
X***************
X*** 580,586
X if ((child = dofork(DORETURN)) == 0) { /* child */
X dup2(fi, 0);
X dup2(fo, 1);
X! n = open(tmpfile, O_WRONLY|O_CREAT|O_TRUNC, 0664);
X if (n >= 0)
X dup2(n, 2);
X for (n = 3; n < NOFILE; n++)
X
X--- 588,594 -----
X if ((child = dofork(DORETURN)) == 0) { /* child */
X dup2(fi, 0);
X dup2(fo, 1);
X! n = open(TmpFile, O_WRONLY|O_CREAT|O_TRUNC, 0664);
X if (n >= 0)
X dup2(n, 2);
X for (n = 3; n < NOFILE; n++)
X***************
X*** 947,954
X printf("\ncould not be printed without an account on %s\n", host);
X break;
X case FILTERERR:
X! if (stat(tmpfile, &stb) < 0 || stb.st_size == 0 ||
X! (fp = fopen(tmpfile, "r")) == NULL) {
X printf("\nwas printed but had some errors\n");
X break;
X }
X
X--- 955,962 -----
X printf("\ncould not be printed without an account on %s\n", host);
X break;
X case FILTERERR:
X! if (stat(TmpFile, &stb) < 0 || stb.st_size == 0 ||
X! (fp = fopen(TmpFile, "r")) == NULL) {
X printf("\nwas printed but had some errors\n");
X break;
X }
X***************
X*** 1007,1013
X */
X abortpr()
X {
X! (void) unlink(tmpfile);
X kill(0, SIGINT);
X if (ofilter > 0)
X kill(ofilter, SIGCONT);
X
X--- 1015,1021 -----
X */
X abortpr()
X {
X! (void) unlink(TmpFile);
X kill(0, SIGINT);
X if (ofilter > 0)
X kill(ofilter, SIGCONT);
X***************
X*** 1227,1233
X */
X setty()
X {
X- struct sgttyb ttybuf;
X register struct bauds *bp;
X
X if (ioctl(pfd, TIOCEXCL, (char *)0) < 0) {
X
X--- 1235,1240 -----
X */
X setty()
X {
X register struct bauds *bp;
X # ifdef sgi
X struct termio tt;
X***************
X*** 1229,1234
X {
X struct sgttyb ttybuf;
X register struct bauds *bp;
X
X if (ioctl(pfd, TIOCEXCL, (char *)0) < 0) {
X syslog(LOG_ERR, "%s: ioctl(TIOCEXCL): %m", printer);
X
X--- 1236,1243 -----
X setty()
X {
X register struct bauds *bp;
X+ # ifdef sgi
X+ struct termio tt;
X
X /*
X * set terminal modes; (THIS HAS NOT BEEN TESTED)
X***************
X*** 1230,1235
X struct sgttyb ttybuf;
X register struct bauds *bp;
X
X if (ioctl(pfd, TIOCEXCL, (char *)0) < 0) {
X syslog(LOG_ERR, "%s: ioctl(TIOCEXCL): %m", printer);
X exit(1);
X
X--- 1239,1290 -----
X # ifdef sgi
X struct termio tt;
X
X+ /*
X+ * set terminal modes; (THIS HAS NOT BEEN TESTED)
X+ *
X+ * should simulate BSD sgtty and local flags (32 in all), to
X+ * facilitate use of BSD printcap files. But as we don't use
X+ * locally attatched printers on any of our SGI boxes, I just
X+ * stuck in the modes set by transcript -- your mileage may
X+ * vary.
X+ */
X+
X+ if (ioctl(pfd, TCGETA, (char *)&tt) < 0) {
X+ syslog(LOG_ERR, "%s: ioctl(TCGETA): %m", printer);
X+ exit(1);
X+ }
X+
X+ tt.c_iflag &= ~(IGNBRK|PARMRK|ISTRIP|INLCR|IGNCR|ICRNL|IUCLC|IXANY);
X+ tt.c_iflag |= BRKINT|INPCK|IXON;
X+
X+ tt.c_oflag |= OPOST;
X+
X+ tt.c_lflag &= ~(ISIG|ICANON|XCASE);
X+
X+ tt.c_cflag &= ~(CSIZE|CLOCAL);
X+ tt.c_cflag |= CS8|CREAD;
X+
X+ tt.c_cc[VMIN] = 1;
X+ tt.c_cc[VTIME] = 4;
X+
X+ if (BR > 0) {
X+ for (bp = bauds; bp->baud; bp++)
X+ if (BR == bp->baud)
X+ break;
X+ if (!bp->baud) {
X+ syslog(LOG_ERR, "%s: illegal baud rate %d", printer, BR);
X+ exit(1);
X+ }
X+ tt.c_cflag &= ~CBAUD;
X+ tt.c_cflag |= bp->speed;
X+ }
X+ if (ioctl(pfd, TCSETA, (char *)&tt) < 0) {
X+ syslog(LOG_ERR, "%s: ioctl(TCSETA): %m", printer);
X+ exit(1);
X+ }
X+ # else
X+ struct sgttyb ttybuf;
X+
X if (ioctl(pfd, TIOCEXCL, (char *)0) < 0) {
X syslog(LOG_ERR, "%s: ioctl(TIOCEXCL): %m", printer);
X exit(1);
X***************
X*** 1274,1279
X exit(1);
X }
X }
X }
X
X /*VARARGS1*/
X
X--- 1329,1335 -----
X exit(1);
X }
X }
X+ # endif
X }
X
X /*VARARGS1*/
END_OF_printjob.c.diff
if test 6929 -ne `wc -c <printjob.c.diff`; then
echo shar: \"printjob.c.diff\" unpacked with wrong size!
fi
# end of overwriting check
fi
if test -f recvjob.c.diff -a "${1}" != "-c" ; then
echo shar: Will not over-write existing file \"recvjob.c.diff\"
else
echo shar: Extracting \"recvjob.c.diff\" \(4122 characters\)
sed "s/^X//" >recvjob.c.diff <<'END_OF_recvjob.c.diff'
X*** recvjob.c.orig Thu Jun 30 21:00:27 1988
X--- recvjob.c Sun Jul 16 01:42:29 1989
X***************
X*** 25,30
X */
X
X #include "lp.h"
X #include <sys/fs.h>
X
X char *sp = "";
X
X--- 25,33 -----
X */
X
X #include "lp.h"
X+ #ifdef sgi
X+ #include <ustat.h>
X+ #else
X #include <sys/fs.h>
X #endif
X
X***************
X*** 26,31
X
X #include "lp.h"
X #include <sys/fs.h>
X
X char *sp = "";
X #define ack() (void) write(1, sp, 1);
X
X--- 29,35 -----
X #include <ustat.h>
X #else
X #include <sys/fs.h>
X+ #endif
X
X char *sp = "";
X #define ack() (void) write(1, sp, 1);
X***************
X*** 33,38
X char tfname[40]; /* tmp copy of cf before linking */
X char dfname[40]; /* data files */
X int minfree; /* keep at least minfree blocks available */
X char *ddev; /* disk device (for checking free space) */
X int dfd; /* file system device descriptor */
X
X
X--- 37,45 -----
X char tfname[40]; /* tmp copy of cf before linking */
X char dfname[40]; /* data files */
X int minfree; /* keep at least minfree blocks available */
X+ # ifdef sgi
X+ dev_t ddev; /* device to check */
X+ # else
X char *ddev; /* disk device (for checking free space) */
X int dfd; /* file system device descriptor */
X
X***************
X*** 37,42
X int dfd; /* file system device descriptor */
X
X char *find_dev();
X
X recvjob()
X {
X
X--- 44,50 -----
X int dfd; /* file system device descriptor */
X
X char *find_dev();
X+ # endif
X
X recvjob()
X {
X***************
X*** 74,79
X }
X } else if (stat(SD, &stb) < 0)
X frecverr("%s: %s: %m", printer, SD);
X minfree = read_number("minfree");
X ddev = find_dev(stb.st_dev, S_IFBLK);
X if ((dfd = open(ddev, O_RDONLY)) < 0)
X
X--- 82,88 -----
X }
X } else if (stat(SD, &stb) < 0)
X frecverr("%s: %s: %m", printer, SD);
X+
X minfree = read_number("minfree");
X # ifdef sgi
X ddev = stb.st_dev;
X***************
X*** 75,80
X } else if (stat(SD, &stb) < 0)
X frecverr("%s: %s: %m", printer, SD);
X minfree = read_number("minfree");
X ddev = find_dev(stb.st_dev, S_IFBLK);
X if ((dfd = open(ddev, O_RDONLY)) < 0)
X syslog(LOG_WARNING, "%s: %s: %m", printer, ddev);
X
X--- 84,92 -----
X frecverr("%s: %s: %m", printer, SD);
X
X minfree = read_number("minfree");
X+ # ifdef sgi
X+ ddev = stb.st_dev;
X+ # else
X ddev = find_dev(stb.st_dev, S_IFBLK);
X if ((dfd = open(ddev, O_RDONLY)) < 0)
X syslog(LOG_WARNING, "%s: %s: %m", printer, ddev);
X***************
X*** 78,83
X ddev = find_dev(stb.st_dev, S_IFBLK);
X if ((dfd = open(ddev, O_RDONLY)) < 0)
X syslog(LOG_WARNING, "%s: %s: %m", printer, ddev);
X signal(SIGTERM, rcleanup);
X signal(SIGPIPE, rcleanup);
X
X
X--- 90,96 -----
X ddev = find_dev(stb.st_dev, S_IFBLK);
X if ((dfd = open(ddev, O_RDONLY)) < 0)
X syslog(LOG_WARNING, "%s: %s: %m", printer, ddev);
X+ # endif
X signal(SIGTERM, rcleanup);
X signal(SIGPIPE, rcleanup);
X
X***************
X*** 85,90
X printjob();
X }
X
X char *
X find_dev(dev, type)
X register dev_t dev;
X
X--- 98,104 -----
X printjob();
X }
X
X+ # ifndef sgi
X char *
X find_dev(dev, type)
X register dev_t dev;
X***************
X*** 114,119
X frecverr("cannot find device %d, %d", major(dev), minor(dev));
X /*NOTREACHED*/
X }
X
X /*
X * Read printer jobs sent by lpd and copy them to the spooling directory.
X
X--- 128,134 -----
X frecverr("cannot find device %d, %d", major(dev), minor(dev));
X /*NOTREACHED*/
X }
X+ # endif
X
X /*
X * Read printer jobs sent by lpd and copy them to the spooling directory.
X***************
X*** 259,264
X chksize(size)
X int size;
X {
X struct stat stb;
X register char *ddev;
X int spacefree;
X
X--- 274,284 -----
X chksize(size)
X int size;
X {
X+ # ifdef sgi
X+ struct ustat us; /* use SVR2 ustat() -- its soo simple! */
X+ if( ustat( ddev, &us ) == 0 && us.f_tfree < minfree )
X+ return(0);
X+ # else
X struct stat stb;
X register char *ddev;
X int spacefree;
X***************
X*** 272,277
X size = (size + 1023) / 1024;
X if (minfree + size > spacefree)
X return(0);
X return(1);
X }
X
X
X--- 292,298 -----
X size = (size + 1023) / 1024;
X if (minfree + size > spacefree)
X return(0);
X+ # endif
X return(1);
X }
X
END_OF_recvjob.c.diff
if test 4122 -ne `wc -c <recvjob.c.diff`; then
echo shar: \"recvjob.c.diff\" unpacked with wrong size!
fi
# end of overwriting check
fi
if test -f startdaemon.c.diff -a "${1}" != "-c" ; then
echo shar: Will not over-write existing file \"startdaemon.c.diff\"
else
echo shar: Extracting \"startdaemon.c.diff\" \(1653 characters\)
sed "s/^X//" >startdaemon.c.diff <<'END_OF_startdaemon.c.diff'
X*** startdaemon.c.orig Thu Jun 30 21:00:28 1988
X--- startdaemon.c Fri Jun 30 15:54:19 1989
X***************
X*** 26,31
X #include <stdio.h>
X #include <sys/types.h>
X #include <sys/socket.h>
X #include <sys/un.h>
X #include "lp.local.h"
X
X
X--- 26,32 -----
X #include <stdio.h>
X #include <sys/types.h>
X #include <sys/socket.h>
X+ #ifndef sgi
X #include <sys/un.h>
X #endif
X #include "lp.local.h"
X***************
X*** 27,32
X #include <sys/types.h>
X #include <sys/socket.h>
X #include <sys/un.h>
X #include "lp.local.h"
X
X startdaemon(printer)
X
X--- 28,34 -----
X #include <sys/socket.h>
X #ifndef sgi
X #include <sys/un.h>
X+ #endif
X #include "lp.local.h"
X
X startdaemon(printer)
X***************
X*** 32,38
X startdaemon(printer)
X char *printer;
X {
X! struct sockaddr_un sun;
X register int s, n;
X char buf[BUFSIZ];
X
X
X--- 34,42 -----
X startdaemon(printer)
X char *printer;
X {
X! # ifndef sgi
X! struct sockaddr_in sin;
X! # endif
X register int s, n;
X char buf[BUFSIZ];
X
X***************
X*** 36,41
X register int s, n;
X char buf[BUFSIZ];
X
X s = socket(AF_UNIX, SOCK_STREAM, 0);
X if (s < 0) {
X perr("socket");
X
X--- 40,48 -----
X register int s, n;
X char buf[BUFSIZ];
X
X+ # ifdef sgi
X+ s = getport( "localhost" );
X+ # else
X s = socket(AF_UNIX, SOCK_STREAM, 0);
X if (s < 0) {
X perr("socket");
X***************
X*** 48,53
X (void) close(s);
X return(0);
X }
X (void) sprintf(buf, "\1%s\n", printer);
X n = strlen(buf);
X if (write(s, buf, n) != n) {
X
X--- 55,61 -----
X (void) close(s);
X return(0);
X }
X+ # endif
X (void) sprintf(buf, "\1%s\n", printer);
X n = strlen(buf);
X if (write(s, buf, n) != n) {
END_OF_startdaemon.c.diff
if test 1653 -ne `wc -c <startdaemon.c.diff`; then
echo shar: \"startdaemon.c.diff\" unpacked with wrong size!
fi
# end of overwriting check
fi
echo shar: End of shell archive.
exit 0
More information about the Comp.sys.sgi
mailing list