Import sources from 2011-03-30 iso image - sys/lib
This commit is contained in:
parent
b41b903422
commit
e463eb4036
1144 changed files with 388460 additions and 0 deletions
47
sys/lib/lp/spooler/generic
Executable file
47
sys/lib/lp/spooler/generic
Executable file
|
@ -0,0 +1,47 @@
|
|||
#!/bin/rc
|
||||
# fn sigexit { rm -f $LPSPOOL/$LPDEST/.$pid.* $LPSPOOL/$LPDEST/$pid.* $LPSPOOL/$LPDEST }
|
||||
if (! ~ $DEBUG '') flag x +
|
||||
|
||||
if (~ $THIS_HOST $DEST_HOST) {
|
||||
if (! test -d $LPSPOOL/$LPDEST) {
|
||||
mkdir $LPSPOOL/$LPDEST
|
||||
chmod 777 $LPSPOOL/$LPDEST >[2]/dev/null
|
||||
}
|
||||
}
|
||||
# Process and enqueue files to be printed
|
||||
# take arguments as input files
|
||||
i=0
|
||||
if (~ $#* 0) *=''
|
||||
for (j in $*) {
|
||||
i= `{echo $i + 1|hoc}
|
||||
|
||||
# check access to the file so that you know that a failure in the
|
||||
# processing is a drastic error which will cause an exit from lp.
|
||||
|
||||
if (~ $j '' || test -f $j) {
|
||||
if (~ $THIS_HOST $DEST_HOST) {
|
||||
echo $LPMACHID $LPUSERID $pid.$i 0 > $LPSPOOL/$LPDEST/.$pid.$i^id
|
||||
if (~ $j '') @{bind -b $LPLIB/process /bin; $LPPROC} >$LPSPOOL/$LPDEST/.$pid.$i
|
||||
if not @{bind -b $LPLIB/process /bin; $LPPROC} <$j >$LPSPOOL/$LPDEST/.$pid.$i
|
||||
if (~ $status '') {
|
||||
mv $LPSPOOL/$LPDEST/.$pid.$i $LPSPOOL/$LPDEST/$pid.$i
|
||||
mv $LPSPOOL/$LPDEST/.$pid.$i^id $LPSPOOL/$LPDEST/$pid.$i^id
|
||||
}
|
||||
if not {
|
||||
rval='preprocessing failed'
|
||||
rm -f $LPSPOOL/$LPDEST/.$pid.$i $LPSPOOL/queue/$LPDEST/.$pid.$i^id
|
||||
exit $rval
|
||||
}
|
||||
}
|
||||
if not {
|
||||
switch ($j) {
|
||||
case ''; @{ {echo -d^$LPDEST -pnoproc -M^$LPMACHID -u^$LPUSERID; bind -b $LPLIB/process /bin; $LPPROC} | lpsend.rc $DEST_HOST}
|
||||
case *; @{ {echo -d^$LPDEST -pnoproc -M^$LPMACHID -u^$LPUSERID; bind -b $LPLIB/process /bin; $LPPROC} < $j | lpsend.rc $DEST_HOST}
|
||||
}
|
||||
rval=$status
|
||||
}
|
||||
}
|
||||
if not {
|
||||
echo $j cannot be opened >[1=2]
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue