Could somebody who is having the 'high load level' or 'LPD consuming all my
system time' problem please try the following patch?
Patrick Powell
*** common/printjob.c 2000/07/14 22:41:01 5.17
--- common/printjob.c 2000/07/21 17:27:41
***************
*** 8,14 ****
***************************************************************************/
static char *const _id =
! "$Id: printjob.c,v 5.17 2000/07/14 22:41:01 papowell Exp $";
#include "lp.h"
--- 8,14 ----
***************************************************************************/
static char *const _id =
! "$Id: printjob.c,v 5.17 2000/07/14 22:41:01 papowell Exp papowell $";
#include "lp.h"
***************
*** 686,691 ****
--- 686,693 ----
* 1 - wait for suspend status
* (if pid <= 0, do not wait)
* )
+ * We write the output buffer to the OF process, and then wait for it to
+ * either exit or suspend itself.
* RETURN: exit code from process
* nn - process exit code
* JSUCC = 0
***************
*** 733,739 ****
msglen = strlen(msg);
DEBUG4("Write_outbuf_to_OF: writing %d", outlen );
DEBUG5("Write_outbuf_to_OF: writing '%s'", buffer );
! count = -1; /* number written */
return_status = Read_write_timeout( of_error, msg+msglen,
msgmax-msglen, &count,
of_fd, &buffer, &outlen, left, writeonly_device );
DEBUG4("Write_outbuf_to_OF: return_status %d, read %d, '%s'",
--- 735,741 ----
msglen = strlen(msg);
DEBUG4("Write_outbuf_to_OF: writing %d", outlen );
DEBUG5("Write_outbuf_to_OF: writing '%s'", buffer );
! count = -1; /* number read into msg buffer */
return_status = Read_write_timeout( of_error, msg+msglen,
msgmax-msglen, &count,
of_fd, &buffer, &outlen, left, writeonly_device );
DEBUG4("Write_outbuf_to_OF: return_status %d, read %d, '%s'",
***************
*** 749,760 ****
}
msglen = strlen(msg);
} else if( count == 0 ){
! DEBUG5("Write_outbuf_to_OF: no more reading");
of_error = -1;
}
}
DEBUG3("Write_outbuf_to_OF: after write return_status %d, of_pid %d, of_fd %d,
of_error %d",
return_status, of_pid, of_fd, of_error );
while( return_status == 0 && of_pid > 0 ){
left = timeout;
if( timeout > 0 ){
--- 751,771 ----
}
msglen = strlen(msg);
} else if( count == 0 ){
! /* EOF on of_error */
! close( of_error );
of_error = -1;
}
}
DEBUG3("Write_outbuf_to_OF: after write return_status %d, of_pid %d, of_fd %d,
of_error %d",
return_status, of_pid, of_fd, of_error );
+
+ /* now we close the output if we are not suspending */
+ if( of_pid > 0 && !suspend ){
+ DEBUG3("Write_outbuf_to_OF: closing of_fd %d", of_fd);
+ close(of_fd);
+ of_fd = -1;
+ }
+
while( return_status == 0 && of_pid > 0 ){
left = timeout;
if( timeout > 0 ){
***************
*** 763,779 ****
left = timeout - elapsed;
if( left <= 0 ){
return_status = JTIMEOUT;
! continue;
}
}
DEBUG3("Write_outbuf_to_OF: waiting for '%s', left %d secs for of_pid
%d",
suspend?"suspend":"exit", left, of_pid );
- if( !suspend && of_fd >= 0 ){
- DEBUG3("Write_outbuf_to_OF: closing of_fd %d", of_fd);
- close(of_fd);
- of_fd = -1;
- }
count = -1;
if( of_error >= 0 ){
/* we see if we have output */
--- 774,785 ----
left = timeout - elapsed;
if( left <= 0 ){
return_status = JTIMEOUT;
! break;
}
}
DEBUG3("Write_outbuf_to_OF: waiting for '%s', left %d secs for of_pid
%d",
suspend?"suspend":"exit", left, of_pid );
count = -1;
if( of_error >= 0 ){
/* we see if we have output */
***************
*** 784,799 ****
DEBUG3("Write_outbuf_to_OF: polling interval %d", left
);
return_status = Wait_for_pid( of_pid, title, suspend,
left );
DEBUG4("Write_outbuf_to_OF: return_status '%s'",
Server_status(return_status));
! m = Read_write_timeout( of_error, msg+msglen,
msgmax-msglen,
! &count, -1, 0, 0, -1, 0 );
! DEBUG4("Write_outbuf_to_OF: Read_write_timeout
returned %d, count %d, msg '%s'",
! m,count,msg);
! } else {
! m = Read_write_timeout( of_error, msg+msglen,
msgmax-msglen,
! &count, -1, 0, 0, -1, 0 );
! DEBUG4("Write_outbuf_to_OF: Read_write_timeout
returned %d, count %d, msg '%s'",
! m,count,msg);
! }
if( count > 0 ){
msglen += count;
msg[msglen] = 0;
--- 790,807 ----
DEBUG3("Write_outbuf_to_OF: polling interval %d", left
);
return_status = Wait_for_pid( of_pid, title, suspend,
left );
DEBUG4("Write_outbuf_to_OF: return_status '%s'",
Server_status(return_status));
! /* we do a poll, just to see if the process is blocked
because the
! * pipe is full. We may need to read the pipe to
clear out the buffer
! * so it can exit. This is really an unusual
condition, but it can happen.
! */
! left = -1;
! }
! /* now we read the error output, just in case there is
something there */
! DEBUG4("Write_outbuf_to_OF: now reading, left %d", left );
! m = Read_write_timeout( of_error, msg+msglen, msgmax-msglen,
! &count, -1, 0, 0, left, 0 );
! DEBUG4("Write_outbuf_to_OF: Read_write_timeout returned %d,
count %d, msg '%s'",
! m,count,msg);
if( count > 0 ){
msglen += count;
msg[msglen] = 0;
-----------------------------------------------------------------------------
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.
-----------------------------------------------------------------------------